<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


The Desugarer: turning HsSyn into Core.
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Desugaring operations</span></span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><a href="GHC.HsToCore.html#deSugar"><span class="hs-identifier">deSugar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.html#deSugarExpr"><span class="hs-identifier">deSugarExpr</span></a></span><span>
</span><span id="line-17"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Usage.html"><span class="hs-identifier">GHC.HsToCore.Usage</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html"><span class="hs-identifier">GHC.Tc.Types</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#finalSafeMode"><span class="hs-identifier">finalSafeMode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#fixSafeInstances"><span class="hs-identifier">fixSafeInstances</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html"><span class="hs-identifier">GHC.Tc.Module</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier">runTcInteractive</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier">tyConDataCons</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html"><span class="hs-identifier">GHC.Types.Avail</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html#exprsSomeFreeVarsList"><span class="hs-identifier">exprsSomeFreeVarsList</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.SimpleOpt.html"><span class="hs-identifier">GHC.Core.SimpleOpt</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.SimpleOpt.html#simpleOptPgm"><span class="hs-identifier">simpleOptPgm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.SimpleOpt.html#simpleOptExpr"><span class="hs-identifier">simpleOptExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Unfold.html"><span class="hs-identifier">GHC.Core.Unfold</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.html"><span class="hs-identifier">GHC.Core.Ppr</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html"><span class="hs-identifier">GHC.HsToCore.Binds</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Foreign.Decl.html"><span class="hs-identifier">GHC.HsToCore.Foreign.Decl</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#dataConWrapId"><span class="hs-identifier">dataConWrapId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html"><span class="hs-identifier">GHC.Core.Rules</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html"><span class="hs-identifier">GHC.Core.Opt.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier">CoreToDo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html"><span class="hs-identifier">GHC.Core.Lint</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html#endPassIO"><span class="hs-identifier">endPassIO</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Coverage.html"><span class="hs-identifier">GHC.HsToCore.Coverage</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Docs.html"><span class="hs-identifier">GHC.HsToCore.Docs</span></a></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Plugins.html"><span class="hs-identifier">GHC.Driver.Plugins</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Plugins.html#LoadedPlugin"><span class="hs-identifier">LoadedPlugin</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*              The main function: deSugar
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | Main entry point to the desugarer.</span><span>
</span><span id="line-84"></span><span class="annot"><a href="GHC.HsToCore.html#deSugar"><span class="hs-identifier hs-type">deSugar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- Can modify PCS by faulting in more declarations</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span id="deSugar"><span class="annot"><span class="annottext">deSugar :: HscEnv -&gt; ModLocation -&gt; TcGblEnv -&gt; IO (Messages, Maybe ModGuts)
</span><a href="GHC.HsToCore.html#deSugar"><span class="hs-identifier hs-var hs-var">deSugar</span></a></span></span><span> </span><span id="local-6989586621681187279"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span>
</span><span id="line-88"></span><span>        </span><span id="local-6989586621681187278"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681187278"><span class="hs-identifier hs-var">mod_loc</span></a></span></span><span>
</span><span id="line-89"></span><span>        </span><span id="local-6989586621681187277"><span class="annot"><span class="annottext">tcg_env :: TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcg_mod :: TcGblEnv -&gt; Module
</span><a href="GHC.Tc.Types.html#tcg_mod"><span class="hs-identifier hs-var">tcg_mod</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187274"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187274"><span class="hs-identifier hs-var">id_mod</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>                            </span><span class="annot"><span class="annottext">tcg_semantic_mod :: TcGblEnv -&gt; Module
</span><a href="GHC.Tc.Types.html#tcg_semantic_mod"><span class="hs-identifier hs-var">tcg_semantic_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187272"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>                            </span><span class="annot"><span class="annottext">tcg_src :: TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var">tcg_src</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187270"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681187270"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>                            </span><span class="annot"><span class="annottext">tcg_type_env :: TcGblEnv -&gt; TypeEnv
</span><a href="GHC.Tc.Types.html#tcg_type_env"><span class="hs-identifier hs-var">tcg_type_env</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187268"><span class="annot"><span class="annottext">TypeEnv
</span><a href="#local-6989586621681187268"><span class="hs-identifier hs-var">type_env</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-93"></span><span>                            </span><span class="annot"><span class="annottext">tcg_imports :: TcGblEnv -&gt; ImportAvails
</span><a href="GHC.Tc.Types.html#tcg_imports"><span class="hs-identifier hs-var">tcg_imports</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187266"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681187266"><span class="hs-identifier hs-var">imports</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-94"></span><span>                            </span><span class="annot"><span class="annottext">tcg_exports :: TcGblEnv -&gt; [AvailInfo]
</span><a href="GHC.Tc.Types.html#tcg_exports"><span class="hs-identifier hs-var">tcg_exports</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187264"><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681187264"><span class="hs-identifier hs-var">exports</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-95"></span><span>                            </span><span class="annot"><span class="annottext">tcg_keep :: TcGblEnv -&gt; TcRef NameSet
</span><a href="GHC.Tc.Types.html#tcg_keep"><span class="hs-identifier hs-var">tcg_keep</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187262"><span class="annot"><span class="annottext">TcRef NameSet
</span><a href="#local-6989586621681187262"><span class="hs-identifier hs-var">keep_var</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-96"></span><span>                            </span><span class="annot"><span class="annottext">tcg_th_splice_used :: TcGblEnv -&gt; TcRef Bool
</span><a href="GHC.Tc.Types.html#tcg_th_splice_used"><span class="hs-identifier hs-var">tcg_th_splice_used</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187260"><span class="annot"><span class="annottext">TcRef Bool
</span><a href="#local-6989586621681187260"><span class="hs-identifier hs-var">tc_splice_used</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-97"></span><span>                            </span><span class="annot"><span class="annottext">tcg_rdr_env :: TcGblEnv -&gt; GlobalRdrEnv
</span><a href="GHC.Tc.Types.html#tcg_rdr_env"><span class="hs-identifier hs-var">tcg_rdr_env</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187258"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681187258"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>                            </span><span class="annot"><span class="annottext">tcg_fix_env :: TcGblEnv -&gt; FixityEnv
</span><a href="GHC.Tc.Types.html#tcg_fix_env"><span class="hs-identifier hs-var">tcg_fix_env</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187256"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681187256"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-99"></span><span>                            </span><span class="annot"><span class="annottext">tcg_inst_env :: TcGblEnv -&gt; InstEnv
</span><a href="GHC.Tc.Types.html#tcg_inst_env"><span class="hs-identifier hs-var">tcg_inst_env</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187254"><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681187254"><span class="hs-identifier hs-var">inst_env</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-100"></span><span>                            </span><span class="annot"><span class="annottext">tcg_fam_inst_env :: TcGblEnv -&gt; FamInstEnv
</span><a href="GHC.Tc.Types.html#tcg_fam_inst_env"><span class="hs-identifier hs-var">tcg_fam_inst_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187252"><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681187252"><span class="hs-identifier hs-var">fam_inst_env</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-101"></span><span>                            </span><span class="annot"><span class="annottext">tcg_merged :: TcGblEnv -&gt; [(Module, Fingerprint)]
</span><a href="GHC.Tc.Types.html#tcg_merged"><span class="hs-identifier hs-var">tcg_merged</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187250"><span class="annot"><span class="annottext">[(Module, Fingerprint)]
</span><a href="#local-6989586621681187250"><span class="hs-identifier hs-var">merged</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>                            </span><span class="annot"><span class="annottext">tcg_warns :: TcGblEnv -&gt; Warnings
</span><a href="GHC.Tc.Types.html#tcg_warns"><span class="hs-identifier hs-var">tcg_warns</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187248"><span class="annot"><span class="annottext">Warnings
</span><a href="#local-6989586621681187248"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-103"></span><span>                            </span><span class="annot"><span class="annottext">tcg_anns :: TcGblEnv -&gt; [Annotation]
</span><a href="GHC.Tc.Types.html#tcg_anns"><span class="hs-identifier hs-var">tcg_anns</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187246"><span class="annot"><span class="annottext">[Annotation]
</span><a href="#local-6989586621681187246"><span class="hs-identifier hs-var">anns</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>                            </span><span class="annot"><span class="annottext">tcg_binds :: TcGblEnv -&gt; LHsBinds GhcTc
</span><a href="GHC.Tc.Types.html#tcg_binds"><span class="hs-identifier hs-var">tcg_binds</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187244"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681187244"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>                            </span><span class="annot"><span class="annottext">tcg_imp_specs :: TcGblEnv -&gt; [LTcSpecPrag]
</span><a href="GHC.Tc.Types.html#tcg_imp_specs"><span class="hs-identifier hs-var">tcg_imp_specs</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187242"><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681187242"><span class="hs-identifier hs-var">imp_specs</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>                            </span><span class="annot"><span class="annottext">tcg_dependent_files :: TcGblEnv -&gt; TcRef [FilePath]
</span><a href="GHC.Tc.Types.html#tcg_dependent_files"><span class="hs-identifier hs-var">tcg_dependent_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187240"><span class="annot"><span class="annottext">TcRef [FilePath]
</span><a href="#local-6989586621681187240"><span class="hs-identifier hs-var">dependent_files</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-107"></span><span>                            </span><span class="annot"><span class="annottext">tcg_ev_binds :: TcGblEnv -&gt; Bag EvBind
</span><a href="GHC.Tc.Types.html#tcg_ev_binds"><span class="hs-identifier hs-var">tcg_ev_binds</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187238"><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681187238"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-108"></span><span>                            </span><span class="annot"><span class="annottext">tcg_th_foreign_files :: TcGblEnv -&gt; TcRef [(ForeignSrcLang, FilePath)]
</span><a href="GHC.Tc.Types.html#tcg_th_foreign_files"><span class="hs-identifier hs-var">tcg_th_foreign_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187236"><span class="annot"><span class="annottext">TcRef [(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681187236"><span class="hs-identifier hs-var">th_foreign_files_var</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-109"></span><span>                            </span><span class="annot"><span class="annottext">tcg_fords :: TcGblEnv -&gt; [LForeignDecl GhcTc]
</span><a href="GHC.Tc.Types.html#tcg_fords"><span class="hs-identifier hs-var">tcg_fords</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187234"><span class="annot"><span class="annottext">[LForeignDecl GhcTc]
</span><a href="#local-6989586621681187234"><span class="hs-identifier hs-var">fords</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>                            </span><span class="annot"><span class="annottext">tcg_rules :: TcGblEnv -&gt; [LRuleDecl GhcTc]
</span><a href="GHC.Tc.Types.html#tcg_rules"><span class="hs-identifier hs-var">tcg_rules</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187232"><span class="annot"><span class="annottext">[LRuleDecl GhcTc]
</span><a href="#local-6989586621681187232"><span class="hs-identifier hs-var">rules</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-111"></span><span>                            </span><span class="annot"><span class="annottext">tcg_patsyns :: TcGblEnv -&gt; [PatSyn]
</span><a href="GHC.Tc.Types.html#tcg_patsyns"><span class="hs-identifier hs-var">tcg_patsyns</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187230"><span class="annot"><span class="annottext">[PatSyn]
</span><a href="#local-6989586621681187230"><span class="hs-identifier hs-var">patsyns</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-112"></span><span>                            </span><span class="annot"><span class="annottext">tcg_tcs :: TcGblEnv -&gt; [TyCon]
</span><a href="GHC.Tc.Types.html#tcg_tcs"><span class="hs-identifier hs-var">tcg_tcs</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187228"><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681187228"><span class="hs-identifier hs-var">tcs</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-113"></span><span>                            </span><span class="annot"><span class="annottext">tcg_insts :: TcGblEnv -&gt; [ClsInst]
</span><a href="GHC.Tc.Types.html#tcg_insts"><span class="hs-identifier hs-var">tcg_insts</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187226"><span class="annot"><span class="annottext">[ClsInst]
</span><a href="#local-6989586621681187226"><span class="hs-identifier hs-var">insts</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-114"></span><span>                            </span><span class="annot"><span class="annottext">tcg_fam_insts :: TcGblEnv -&gt; [FamInst]
</span><a href="GHC.Tc.Types.html#tcg_fam_insts"><span class="hs-identifier hs-var">tcg_fam_insts</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187224"><span class="annot"><span class="annottext">[FamInst]
</span><a href="#local-6989586621681187224"><span class="hs-identifier hs-var">fam_insts</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-115"></span><span>                            </span><span class="annot"><span class="annottext">tcg_hpc :: TcGblEnv -&gt; Bool
</span><a href="GHC.Tc.Types.html#tcg_hpc"><span class="hs-identifier hs-var">tcg_hpc</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187222"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681187222"><span class="hs-identifier hs-var">other_hpc_info</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-116"></span><span>                            </span><span class="annot"><span class="annottext">tcg_complete_matches :: TcGblEnv -&gt; [CompleteMatch]
</span><a href="GHC.Tc.Types.html#tcg_complete_matches"><span class="hs-identifier hs-var">tcg_complete_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187220"><span class="annot"><span class="annottext">[CompleteMatch]
</span><a href="#local-6989586621681187220"><span class="hs-identifier hs-var">complete_matches</span></a></span></span><span>
</span><span id="line-117"></span><span>                            </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187219"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-120"></span><span>             </span><span id="local-6989586621681187217"><span class="annot"><span class="annottext">print_unqual :: PrintUnqualified
</span><a href="#local-6989586621681187217"><span class="hs-identifier hs-var hs-var">print_unqual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalRdrEnv -&gt; PrintUnqualified
</span><a href="GHC.Driver.Types.html#mkPrintUnqualified"><span class="hs-identifier hs-var">mkPrintUnqualified</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681187258"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-121"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; SDoc
-&gt; ((Messages, Maybe ModGuts) -&gt; ())
-&gt; IO (Messages, Maybe ModGuts)
-&gt; IO (Messages, Maybe ModGuts)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-122"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Desugar&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; (Messages, Maybe ModGuts) -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO (Messages, Maybe ModGuts) -&gt; IO (Messages, Maybe ModGuts))
-&gt; IO (Messages, Maybe ModGuts) -&gt; IO (Messages, Maybe ModGuts)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-124"></span><span>     </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Desugar the program</span><span>
</span><span id="line-125"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187209"><span class="annot"><span class="annottext">export_set :: NameSet
</span><a href="#local-6989586621681187209"><span class="hs-identifier hs-var hs-var">export_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo] -&gt; NameSet
</span><a href="GHC.Types.Avail.html#availsToNameSet"><span class="hs-identifier hs-var">availsToNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681187264"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-126"></span><span>              </span><span id="local-6989586621681187207"><span class="annot"><span class="annottext">target :: HscTarget
</span><a href="#local-6989586621681187207"><span class="hs-identifier hs-var hs-var">target</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-127"></span><span>              </span><span id="local-6989586621681187205"><span class="annot"><span class="annottext">hpcInfo :: HpcInfo
</span><a href="#local-6989586621681187205"><span class="hs-identifier hs-var hs-var">hpcInfo</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; HpcInfo
</span><a href="GHC.Driver.Types.html#emptyHpcInfo"><span class="hs-identifier hs-var">emptyHpcInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681187222"><span class="hs-identifier hs-var">other_hpc_info</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187203"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681187203"><span class="hs-identifier hs-var">binds_cvr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187202"><span class="annot"><span class="annottext">HpcInfo
</span><a href="#local-6989586621681187202"><span class="hs-identifier hs-var">ds_hpc_info</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187201"><span class="annot"><span class="annottext">Maybe ModBreaks
</span><a href="#local-6989586621681187201"><span class="hs-identifier hs-var">modBreaks</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>                         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscSource -&gt; Bool
</span><a href="GHC.Driver.Phases.html#isHsBootOrSig"><span class="hs-identifier hs-var">isHsBootOrSig</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681187270"><span class="hs-identifier hs-var">hsc_src</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>                              </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Module
-&gt; ModLocation
-&gt; NameSet
-&gt; [TyCon]
-&gt; LHsBinds GhcTc
-&gt; IO (LHsBinds GhcTc, HpcInfo, Maybe ModBreaks)
</span><a href="GHC.HsToCore.Coverage.html#addTicksToBinds"><span class="hs-identifier hs-var">addTicksToBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681187278"><span class="hs-identifier hs-var">mod_loc</span></a></span><span>
</span><span id="line-132"></span><span>                                       </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187209"><span class="hs-identifier hs-var">export_set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TypeEnv -&gt; [TyCon]
</span><a href="GHC.Driver.Types.html#typeEnvTyCons"><span class="hs-identifier hs-var">typeEnvTyCons</span></a></span><span> </span><span class="annot"><span class="annottext">TypeEnv
</span><a href="#local-6989586621681187268"><span class="hs-identifier hs-var">type_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681187244"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-133"></span><span>                              </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(LHsBinds GhcTc, HpcInfo, Maybe ModBreaks)
-&gt; IO (LHsBinds GhcTc, HpcInfo, Maybe ModBreaks)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681187244"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HpcInfo
</span><a href="#local-6989586621681187205"><span class="hs-identifier hs-var">hpcInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe ModBreaks
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187196"><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681187196"><span class="hs-identifier hs-var">msgs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187195"><span class="annot"><span class="annottext">Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
</span><a href="#local-6989586621681187195"><span class="hs-identifier hs-var">mb_res</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; TcGblEnv
-&gt; DsM ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
-&gt; IO
     (Messages,
      Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs))
forall a. HscEnv -&gt; TcGblEnv -&gt; DsM a -&gt; IO (Messages, Maybe a)
</span><a href="GHC.HsToCore.Monad.html#initDs"><span class="hs-identifier hs-var">initDs</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
 -&gt; IO
      (Messages,
       Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)))
-&gt; DsM ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
-&gt; IO
     (Messages,
      Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-135"></span><span>                       </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681187193"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187193"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Bag EvBind -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsEvBinds"><span class="hs-identifier hs-var">dsEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681187238"><span class="hs-identifier hs-var">ev_binds</span></a></span><span>
</span><span id="line-136"></span><span>                          </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187191"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187191"><span class="hs-identifier hs-var">core_prs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; DsM (OrdList Binding)
</span><a href="GHC.HsToCore.Binds.html#dsTopLHsBinds"><span class="hs-identifier hs-var">dsTopLHsBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681187203"><span class="hs-identifier hs-var">binds_cvr</span></a></span><span>
</span><span id="line-137"></span><span>                          </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187189"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187189"><span class="hs-identifier hs-var">core_prs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OrdList Binding -&gt; DsM (OrdList Binding)
</span><a href="GHC.HsToCore.html#patchMagicDefns"><span class="hs-identifier hs-var">patchMagicDefns</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187191"><span class="hs-identifier hs-var">core_prs</span></a></span><span>
</span><span id="line-138"></span><span>                          </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187187"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187187"><span class="hs-identifier hs-var">spec_prs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187186"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187186"><span class="hs-identifier hs-var">spec_rules</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; DsM (OrdList Binding, [CoreRule])
</span><a href="GHC.HsToCore.html#dsImpSpecs"><span class="hs-identifier hs-var">dsImpSpecs</span></a></span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681187242"><span class="hs-identifier hs-var">imp_specs</span></a></span><span>
</span><span id="line-139"></span><span>                          </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187184"><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681187184"><span class="hs-identifier hs-var">ds_fords</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187183"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187183"><span class="hs-identifier hs-var">foreign_prs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LForeignDecl GhcTc] -&gt; DsM (ForeignStubs, OrdList Binding)
</span><a href="GHC.HsToCore.Foreign.Decl.html#dsForeigns"><span class="hs-identifier hs-var">dsForeigns</span></a></span><span> </span><span class="annot"><span class="annottext">[LForeignDecl GhcTc]
</span><a href="#local-6989586621681187234"><span class="hs-identifier hs-var">fords</span></a></span><span>
</span><span id="line-140"></span><span>                          </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187181"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187181"><span class="hs-identifier hs-var">ds_rules</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LRuleDecl GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule))
-&gt; [LRuleDecl GhcTc] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreRule]
forall (m :: * -&gt; *) a b.
Applicative m =&gt;
(a -&gt; m (Maybe b)) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#mapMaybeM"><span class="hs-identifier hs-var">mapMaybeM</span></a></span><span> </span><span class="annot"><span class="annottext">LRuleDecl GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
</span><a href="GHC.HsToCore.html#dsRule"><span class="hs-identifier hs-var">dsRule</span></a></span><span> </span><span class="annot"><span class="annottext">[LRuleDecl GhcTc]
</span><a href="#local-6989586621681187232"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-141"></span><span>                          </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187178"><span class="annot"><span class="annottext">hpc_init :: SDoc
</span><a href="#local-6989586621681187178"><span class="hs-identifier hs-var hs-var">hpc_init</span></a></span></span><span>
</span><span id="line-142"></span><span>                                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Hpc"><span class="hs-identifier hs-var">Opt_Hpc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; HpcInfo -&gt; SDoc
</span><a href="GHC.HsToCore.Coverage.html#hpcInitCode"><span class="hs-identifier hs-var">hpcInitCode</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">HpcInfo
</span><a href="#local-6989586621681187202"><span class="hs-identifier hs-var">ds_hpc_info</span></a></span><span>
</span><span id="line-143"></span><span>                                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-144"></span><span>                          </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
-&gt; DsM ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187193"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span>
</span><span id="line-145"></span><span>                                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187183"><span class="hs-identifier hs-var">foreign_prs</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding -&gt; OrdList Binding -&gt; OrdList Binding
forall a. OrdList a -&gt; OrdList a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#appOL"><span class="hs-operator hs-var">`appOL`</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187189"><span class="hs-identifier hs-var">core_prs</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding -&gt; OrdList Binding -&gt; OrdList Binding
forall a. OrdList a -&gt; OrdList a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#appOL"><span class="hs-operator hs-var">`appOL`</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187187"><span class="hs-identifier hs-var">spec_prs</span></a></span><span>
</span><span id="line-146"></span><span>                                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187186"><span class="hs-identifier hs-var">spec_rules</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule] -&gt; [CoreRule] -&gt; [CoreRule]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187181"><span class="hs-identifier hs-var">ds_rules</span></a></span><span>
</span><span id="line-147"></span><span>                                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681187184"><span class="hs-identifier hs-var">ds_fords</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignStubs -&gt; SDoc -&gt; ForeignStubs
</span><a href="GHC.Driver.Types.html#appendStubC"><span class="hs-operator hs-var">`appendStubC`</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681187178"><span class="hs-identifier hs-var">hpc_init</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
</span><a href="#local-6989586621681187195"><span class="hs-identifier hs-var">mb_res</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-150"></span><span>           </span><span class="annot"><span class="annottext">Maybe ([CoreBind], OrdList Binding, [CoreRule], ForeignStubs)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Messages, Maybe ModGuts) -&gt; IO (Messages, Maybe ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681187196"><span class="hs-identifier hs-var">msgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe ModGuts
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-151"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187171"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187171"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187170"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187170"><span class="hs-identifier hs-var">all_prs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187169"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187169"><span class="hs-identifier hs-var">all_rules</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187168"><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681187168"><span class="hs-identifier hs-var">ds_fords</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>     </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- Add export flags to bindings</span><span>
</span><span id="line-154"></span><span>          </span><span id="local-6989586621681187167"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187167"><span class="hs-identifier hs-var">keep_alive</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRef NameSet -&gt; IO NameSet
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef NameSet
</span><a href="#local-6989586621681187262"><span class="hs-identifier hs-var">keep_var</span></a></span><span>
</span><span id="line-155"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187165"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187165"><span class="hs-identifier hs-var">rules_for_locals</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187164"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187164"><span class="hs-identifier hs-var">rules_for_imps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreRule -&gt; Bool) -&gt; [CoreRule] -&gt; ([CoreRule], [CoreRule])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule -&gt; Bool
</span><a href="GHC.Core.html#isLocalRule"><span class="hs-identifier hs-var">isLocalRule</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187169"><span class="hs-identifier hs-var">all_rules</span></a></span><span>
</span><span id="line-156"></span><span>              </span><span id="local-6989586621681187161"><span class="annot"><span class="annottext">final_prs :: [Binding]
</span><a href="#local-6989586621681187161"><span class="hs-identifier hs-var hs-var">final_prs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscTarget
-&gt; NameSet -&gt; NameSet -&gt; [CoreRule] -&gt; [Binding] -&gt; [Binding]
forall t.
HscTarget
-&gt; NameSet -&gt; NameSet -&gt; [CoreRule] -&gt; [(Id, t)] -&gt; [(Id, t)]
</span><a href="GHC.HsToCore.html#addExportFlagsAndRules"><span class="hs-identifier hs-var">addExportFlagsAndRules</span></a></span><span> </span><span class="annot"><span class="annottext">HscTarget
</span><a href="#local-6989586621681187207"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187209"><span class="hs-identifier hs-var">export_set</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187167"><span class="hs-identifier hs-var">keep_alive</span></a></span><span>
</span><span id="line-157"></span><span>                                                 </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187165"><span class="hs-identifier hs-var">rules_for_locals</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList Binding -&gt; [Binding]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681187170"><span class="hs-identifier hs-var">all_prs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>              </span><span id="local-6989586621681187158"><span class="annot"><span class="annottext">final_pgm :: [CoreBind]
</span><a href="#local-6989586621681187158"><span class="hs-identifier hs-var hs-var">final_pgm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [Binding] -&gt; [CoreBind]
</span><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187171"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187161"><span class="hs-identifier hs-var">final_prs</span></a></span><span>
</span><span id="line-160"></span><span>        </span><span class="hs-comment">-- Notice that we put the whole lot in a big Rec, even the foreign binds</span><span>
</span><span id="line-161"></span><span>        </span><span class="hs-comment">-- When compiling PrelFloat, which defines data Float = F# Float#</span><span>
</span><span id="line-162"></span><span>        </span><span class="hs-comment">-- we want F# to be in scope in the foreign marshalling code!</span><span>
</span><span id="line-163"></span><span>        </span><span class="hs-comment">-- You might think it doesn't matter, but the simplifier brings all top-level</span><span>
</span><span id="line-164"></span><span>        </span><span class="hs-comment">-- things into the in-scope set before simplifying; so we get no unfolding for F#!</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; PrintUnqualified
-&gt; CoreToDo
-&gt; [CoreBind]
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Lint.html#endPassIO"><span class="hs-identifier hs-var">endPassIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681187217"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDesugar"><span class="hs-identifier hs-var">CoreDesugar</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187158"><span class="hs-identifier hs-var">final_pgm</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187164"><span class="hs-identifier hs-var">rules_for_imps</span></a></span><span>
</span><span id="line-167"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187155"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187155"><span class="hs-identifier hs-var">ds_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187154"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187154"><span class="hs-identifier hs-var">ds_rules_for_imps</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Module
-&gt; [CoreBind]
-&gt; [CoreRule]
-&gt; IO ([CoreBind], [CoreRule])
</span><a href="GHC.Core.SimpleOpt.html#simpleOptPgm"><span class="hs-identifier hs-var">simpleOptPgm</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187158"><span class="hs-identifier hs-var">final_pgm</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187164"><span class="hs-identifier hs-var">rules_for_imps</span></a></span><span>
</span><span id="line-169"></span><span>                         </span><span class="hs-comment">-- The simpleOptPgm gets rid of type</span><span>
</span><span id="line-170"></span><span>                         </span><span class="hs-comment">-- bindings plus any stupid dead code</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; PrintUnqualified
-&gt; CoreToDo
-&gt; [CoreBind]
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Lint.html#endPassIO"><span class="hs-identifier hs-var">endPassIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681187217"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDesugarOpt"><span class="hs-identifier hs-var">CoreDesugarOpt</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187155"><span class="hs-identifier hs-var">ds_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187154"><span class="hs-identifier hs-var">ds_rules_for_imps</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187152"><span class="annot"><span class="annottext">used_names :: NameSet
</span><a href="#local-6989586621681187152"><span class="hs-identifier hs-var hs-var">used_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; NameSet
</span><a href="GHC.HsToCore.Usage.html#mkUsedNames"><span class="hs-identifier hs-var">mkUsedNames</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span><span>
</span><span id="line-175"></span><span>              </span><span id="local-6989586621681187150"><span class="annot"><span class="annottext">pluginModules :: [ModIface]
</span><a href="#local-6989586621681187150"><span class="hs-identifier hs-var hs-var">pluginModules</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-176"></span><span>                </span><span class="annot"><span class="annottext">(LoadedPlugin -&gt; ModIface) -&gt; [LoadedPlugin] -&gt; [ModIface]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LoadedPlugin -&gt; ModIface
</span><a href="GHC.Driver.Plugins.html#lpModule"><span class="hs-identifier hs-var hs-var">lpModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; [LoadedPlugin]
</span><a href="GHC.Driver.Session.html#cachedPlugins"><span class="hs-identifier hs-var hs-var">cachedPlugins</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187147"><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681187147"><span class="hs-identifier hs-var">deps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; [Module] -&gt; TcGblEnv -&gt; IO Dependencies
</span><a href="GHC.HsToCore.Usage.html#mkDependencies"><span class="hs-identifier hs-var">mkDependencies</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitId
</span><a href="GHC.Driver.Session.html#homeUnitId"><span class="hs-identifier hs-var hs-var">homeUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ModIface -&gt; Module) -&gt; [ModIface] -&gt; [Module]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface -&gt; Module
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; Module
</span><a href="GHC.Driver.Types.html#mi_module"><span class="hs-identifier hs-var hs-var">mi_module</span></a></span><span> </span><span class="annot"><span class="annottext">[ModIface]
</span><a href="#local-6989586621681187150"><span class="hs-identifier hs-var">pluginModules</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187143"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681187143"><span class="hs-identifier hs-var">used_th</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRef Bool -&gt; IO Bool
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef Bool
</span><a href="#local-6989586621681187260"><span class="hs-identifier hs-var">tc_splice_used</span></a></span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187142"><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681187142"><span class="hs-identifier hs-var">dep_files</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRef [FilePath] -&gt; IO [FilePath]
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [FilePath]
</span><a href="#local-6989586621681187240"><span class="hs-identifier hs-var">dependent_files</span></a></span><span>
</span><span id="line-182"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187141"><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681187141"><span class="hs-identifier hs-var">safe_mode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; TcGblEnv -&gt; IO SafeHaskellMode
</span><a href="GHC.Tc.Utils.Monad.html#finalSafeMode"><span class="hs-identifier hs-var">finalSafeMode</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187219"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span><span>
</span><span id="line-183"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187140"><span class="annot"><span class="annottext">[Usage]
</span><a href="#local-6989586621681187140"><span class="hs-identifier hs-var">usages</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Module
-&gt; ImportedMods
-&gt; NameSet
-&gt; [FilePath]
-&gt; [(Module, Fingerprint)]
-&gt; [ModIface]
-&gt; IO [Usage]
</span><a href="GHC.HsToCore.Usage.html#mkUsageInfo"><span class="hs-identifier hs-var">mkUsageInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187279"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportAvails -&gt; ImportedMods
</span><a href="GHC.Tc.Types.html#imp_mods"><span class="hs-identifier hs-var hs-var">imp_mods</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681187266"><span class="hs-identifier hs-var">imports</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187152"><span class="hs-identifier hs-var">used_names</span></a></span><span>
</span><span id="line-184"></span><span>                      </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681187142"><span class="hs-identifier hs-var">dep_files</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, Fingerprint)]
</span><a href="#local-6989586621681187250"><span class="hs-identifier hs-var">merged</span></a></span><span> </span><span class="annot"><span class="annottext">[ModIface]
</span><a href="#local-6989586621681187150"><span class="hs-identifier hs-var">pluginModules</span></a></span><span>
</span><span id="line-185"></span><span>        </span><span class="hs-comment">-- id_mod /= mod when we are processing an hsig, but hsigs</span><span>
</span><span id="line-186"></span><span>        </span><span class="hs-comment">-- never desugared and compiled (there's no code!)</span><span>
</span><span id="line-187"></span><span>        </span><span class="hs-comment">-- Consequently, this should hold for any ModGuts that make</span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-comment">-- past desugaring. See Note [Identity versus semantic module].</span><span>
</span><span id="line-189"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">id_mod</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">mod</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187134"><span class="annot"><span class="annottext">[(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681187134"><span class="hs-identifier hs-var">foreign_files</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRef [(ForeignSrcLang, FilePath)]
-&gt; IO [(ForeignSrcLang, FilePath)]
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681187236"><span class="hs-identifier hs-var">th_foreign_files_var</span></a></span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187133"><span class="annot"><span class="annottext">Maybe HsDocString
</span><a href="#local-6989586621681187133"><span class="hs-identifier hs-var">doc_hdr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187132"><span class="annot"><span class="annottext">DeclDocMap
</span><a href="#local-6989586621681187132"><span class="hs-identifier hs-var">decl_docs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187131"><span class="annot"><span class="annottext">ArgDocMap
</span><a href="#local-6989586621681187131"><span class="hs-identifier hs-var">arg_docs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; (Maybe HsDocString, DeclDocMap, ArgDocMap)
</span><a href="GHC.HsToCore.Docs.html#extractDocs"><span class="hs-identifier hs-var">extractDocs</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681187277"><span class="hs-identifier hs-var">tcg_env</span></a></span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187129"><span class="annot"><span class="annottext">mod_guts :: ModGuts
</span><a href="#local-6989586621681187129"><span class="hs-identifier hs-var hs-var">mod_guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts :: Module
-&gt; HscSource
-&gt; SrcSpan
-&gt; [AvailInfo]
-&gt; Dependencies
-&gt; [Usage]
-&gt; Bool
-&gt; GlobalRdrEnv
-&gt; FixityEnv
-&gt; [TyCon]
-&gt; [ClsInst]
-&gt; [FamInst]
-&gt; [PatSyn]
-&gt; [CoreRule]
-&gt; [CoreBind]
-&gt; ForeignStubs
-&gt; [(ForeignSrcLang, FilePath)]
-&gt; Warnings
-&gt; [Annotation]
-&gt; [CompleteMatch]
-&gt; HpcInfo
-&gt; Maybe ModBreaks
-&gt; InstEnv
-&gt; FamInstEnv
-&gt; SafeHaskellMode
-&gt; Bool
-&gt; Maybe HsDocString
-&gt; DeclDocMap
-&gt; ArgDocMap
-&gt; ModGuts
</span><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-196"></span><span>                </span><span class="annot"><span class="annottext">mg_module :: Module
</span><a href="#local-6989586621681187127"><span class="hs-identifier hs-var">mg_module</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187272"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-197"></span><span>                </span><span class="annot"><span class="annottext">mg_hsc_src :: HscSource
</span><a href="#local-6989586621681187126"><span class="hs-identifier hs-var">mg_hsc_src</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681187270"><span class="hs-identifier hs-var">hsc_src</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-198"></span><span>                </span><span class="annot"><span class="annottext">mg_loc :: SrcSpan
</span><a href="#local-6989586621681187125"><span class="hs-identifier hs-var">mg_loc</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; SrcSpan
</span><a href="GHC.HsToCore.html#mkFileSrcSpan"><span class="hs-identifier hs-var">mkFileSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681187278"><span class="hs-identifier hs-var">mod_loc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-199"></span><span>                </span><span class="annot"><span class="annottext">mg_exports :: [AvailInfo]
</span><a href="#local-6989586621681187123"><span class="hs-identifier hs-var">mg_exports</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681187264"><span class="hs-identifier hs-var">exports</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-200"></span><span>                </span><span class="annot"><span class="annottext">mg_usages :: [Usage]
</span><a href="#local-6989586621681187122"><span class="hs-identifier hs-var">mg_usages</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Usage]
</span><a href="#local-6989586621681187140"><span class="hs-identifier hs-var">usages</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-201"></span><span>                </span><span class="annot"><span class="annottext">mg_deps :: Dependencies
</span><a href="#local-6989586621681187121"><span class="hs-identifier hs-var">mg_deps</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681187147"><span class="hs-identifier hs-var">deps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-202"></span><span>                </span><span class="annot"><span class="annottext">mg_used_th :: Bool
</span><a href="#local-6989586621681187120"><span class="hs-identifier hs-var">mg_used_th</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681187143"><span class="hs-identifier hs-var">used_th</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-203"></span><span>                </span><span class="annot"><span class="annottext">mg_rdr_env :: GlobalRdrEnv
</span><a href="#local-6989586621681187119"><span class="hs-identifier hs-var">mg_rdr_env</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681187258"><span class="hs-identifier hs-var">rdr_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-204"></span><span>                </span><span class="annot"><span class="annottext">mg_fix_env :: FixityEnv
</span><a href="#local-6989586621681187118"><span class="hs-identifier hs-var">mg_fix_env</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681187256"><span class="hs-identifier hs-var">fix_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-205"></span><span>                </span><span class="annot"><span class="annottext">mg_warns :: Warnings
</span><a href="#local-6989586621681187117"><span class="hs-identifier hs-var">mg_warns</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Warnings
</span><a href="#local-6989586621681187248"><span class="hs-identifier hs-var">warns</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-206"></span><span>                </span><span class="annot"><span class="annottext">mg_anns :: [Annotation]
</span><a href="#local-6989586621681187116"><span class="hs-identifier hs-var">mg_anns</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Annotation]
</span><a href="#local-6989586621681187246"><span class="hs-identifier hs-var">anns</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-207"></span><span>                </span><span class="annot"><span class="annottext">mg_tcs :: [TyCon]
</span><a href="#local-6989586621681187115"><span class="hs-identifier hs-var">mg_tcs</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681187228"><span class="hs-identifier hs-var">tcs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-208"></span><span>                </span><span class="annot"><span class="annottext">mg_insts :: [ClsInst]
</span><a href="#local-6989586621681187114"><span class="hs-identifier hs-var">mg_insts</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode -&gt; [ClsInst] -&gt; [ClsInst]
</span><a href="GHC.Tc.Utils.Monad.html#fixSafeInstances"><span class="hs-identifier hs-var">fixSafeInstances</span></a></span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681187141"><span class="hs-identifier hs-var">safe_mode</span></a></span><span> </span><span class="annot"><span class="annottext">[ClsInst]
</span><a href="#local-6989586621681187226"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-209"></span><span>                </span><span class="annot"><span class="annottext">mg_fam_insts :: [FamInst]
</span><a href="#local-6989586621681187113"><span class="hs-identifier hs-var">mg_fam_insts</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FamInst]
</span><a href="#local-6989586621681187224"><span class="hs-identifier hs-var">fam_insts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-210"></span><span>                </span><span class="annot"><span class="annottext">mg_inst_env :: InstEnv
</span><a href="#local-6989586621681187112"><span class="hs-identifier hs-var">mg_inst_env</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstEnv
</span><a href="#local-6989586621681187254"><span class="hs-identifier hs-var">inst_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-211"></span><span>                </span><span class="annot"><span class="annottext">mg_fam_inst_env :: FamInstEnv
</span><a href="#local-6989586621681187111"><span class="hs-identifier hs-var">mg_fam_inst_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FamInstEnv
</span><a href="#local-6989586621681187252"><span class="hs-identifier hs-var">fam_inst_env</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-212"></span><span>                </span><span class="annot"><span class="annottext">mg_patsyns :: [PatSyn]
</span><a href="#local-6989586621681187110"><span class="hs-identifier hs-var">mg_patsyns</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PatSyn]
</span><a href="#local-6989586621681187230"><span class="hs-identifier hs-var">patsyns</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-213"></span><span>                </span><span class="annot"><span class="annottext">mg_rules :: [CoreRule]
</span><a href="#local-6989586621681187109"><span class="hs-identifier hs-var">mg_rules</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187154"><span class="hs-identifier hs-var">ds_rules_for_imps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-214"></span><span>                </span><span class="annot"><span class="annottext">mg_binds :: [CoreBind]
</span><a href="#local-6989586621681187108"><span class="hs-identifier hs-var">mg_binds</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187155"><span class="hs-identifier hs-var">ds_binds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-215"></span><span>                </span><span class="annot"><span class="annottext">mg_foreign :: ForeignStubs
</span><a href="#local-6989586621681187107"><span class="hs-identifier hs-var">mg_foreign</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681187168"><span class="hs-identifier hs-var">ds_fords</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-216"></span><span>                </span><span class="annot"><span class="annottext">mg_foreign_files :: [(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681187106"><span class="hs-identifier hs-var">mg_foreign_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681187134"><span class="hs-identifier hs-var">foreign_files</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-217"></span><span>                </span><span class="annot"><span class="annottext">mg_hpc_info :: HpcInfo
</span><a href="#local-6989586621681187105"><span class="hs-identifier hs-var">mg_hpc_info</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HpcInfo
</span><a href="#local-6989586621681187202"><span class="hs-identifier hs-var">ds_hpc_info</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-218"></span><span>                </span><span class="annot"><span class="annottext">mg_modBreaks :: Maybe ModBreaks
</span><a href="#local-6989586621681187104"><span class="hs-identifier hs-var">mg_modBreaks</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ModBreaks
</span><a href="#local-6989586621681187201"><span class="hs-identifier hs-var">modBreaks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-219"></span><span>                </span><span class="annot"><span class="annottext">mg_safe_haskell :: SafeHaskellMode
</span><a href="#local-6989586621681187103"><span class="hs-identifier hs-var">mg_safe_haskell</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SafeHaskellMode
</span><a href="#local-6989586621681187141"><span class="hs-identifier hs-var">safe_mode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-220"></span><span>                </span><span class="annot"><span class="annottext">mg_trust_pkg :: Bool
</span><a href="#local-6989586621681187102"><span class="hs-identifier hs-var">mg_trust_pkg</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImportAvails -&gt; Bool
</span><a href="GHC.Tc.Types.html#imp_trust_own_pkg"><span class="hs-identifier hs-var hs-var">imp_trust_own_pkg</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681187266"><span class="hs-identifier hs-var">imports</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-221"></span><span>                </span><span class="annot"><span class="annottext">mg_complete_sigs :: [CompleteMatch]
</span><a href="#local-6989586621681187100"><span class="hs-identifier hs-var">mg_complete_sigs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CompleteMatch]
</span><a href="#local-6989586621681187220"><span class="hs-identifier hs-var">complete_matches</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-222"></span><span>                </span><span class="annot"><span class="annottext">mg_doc_hdr :: Maybe HsDocString
</span><a href="#local-6989586621681187099"><span class="hs-identifier hs-var">mg_doc_hdr</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe HsDocString
</span><a href="#local-6989586621681187133"><span class="hs-identifier hs-var">doc_hdr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-223"></span><span>                </span><span class="annot"><span class="annottext">mg_decl_docs :: DeclDocMap
</span><a href="#local-6989586621681187098"><span class="hs-identifier hs-var">mg_decl_docs</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DeclDocMap
</span><a href="#local-6989586621681187132"><span class="hs-identifier hs-var">decl_docs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-224"></span><span>                </span><span class="annot"><span class="annottext">mg_arg_docs :: ArgDocMap
</span><a href="#local-6989586621681187097"><span class="hs-identifier hs-var">mg_arg_docs</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArgDocMap
</span><a href="#local-6989586621681187131"><span class="hs-identifier hs-var">arg_docs</span></a></span><span>
</span><span id="line-225"></span><span>              </span><span class="hs-special">}</span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Messages, Maybe ModGuts) -&gt; IO (Messages, Maybe ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681187196"><span class="hs-identifier hs-var">msgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; Maybe ModGuts
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681187129"><span class="hs-identifier hs-var">mod_guts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="annot"><a href="GHC.HsToCore.html#mkFileSrcSpan"><span class="hs-identifier hs-type">mkFileSrcSpan</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-230"></span><span id="mkFileSrcSpan"><span class="annot"><span class="annottext">mkFileSrcSpan :: ModLocation -&gt; SrcSpan
</span><a href="GHC.HsToCore.html#mkFileSrcSpan"><span class="hs-identifier hs-var hs-var">mkFileSrcSpan</span></a></span></span><span> </span><span id="local-6989586621681187096"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681187096"><span class="hs-identifier hs-var">mod_loc</span></a></span></span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681187096"><span class="hs-identifier hs-var">mod_loc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-232"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681187094"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681187094"><span class="hs-identifier hs-var">file_path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#mkGeneralSrcSpan"><span class="hs-identifier hs-var">mkGeneralSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681187094"><span class="hs-identifier hs-var">file_path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>      </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#interactiveSrcSpan"><span class="hs-identifier hs-var">interactiveSrcSpan</span></a></span><span>   </span><span class="hs-comment">-- Presumably</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="annot"><a href="GHC.HsToCore.html#dsImpSpecs"><span class="hs-identifier hs-type">dsImpSpecs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LTcSpecPrag"><span class="hs-identifier hs-type">LTcSpecPrag</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span id="dsImpSpecs"><span class="annot"><span class="annottext">dsImpSpecs :: [LTcSpecPrag] -&gt; DsM (OrdList Binding, [CoreRule])
</span><a href="GHC.HsToCore.html#dsImpSpecs"><span class="hs-identifier hs-var hs-var">dsImpSpecs</span></a></span></span><span> </span><span id="local-6989586621681187090"><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681187090"><span class="hs-identifier hs-var">imp_specs</span></a></span></span><span>
</span><span id="line-237"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681187089"><span class="annot"><span class="annottext">[(OrdList Binding, CoreRule)]
</span><a href="#local-6989586621681187089"><span class="hs-identifier hs-var">spec_prs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LTcSpecPrag
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv) (Maybe (OrdList Binding, CoreRule)))
-&gt; [LTcSpecPrag]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [(OrdList Binding, CoreRule)]
forall (m :: * -&gt; *) a b.
Applicative m =&gt;
(a -&gt; m (Maybe b)) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#mapMaybeM"><span class="hs-identifier hs-var">mapMaybeM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe CoreExpr
-&gt; LTcSpecPrag
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv) (Maybe (OrdList Binding, CoreRule))
</span><a href="GHC.HsToCore.Binds.html#dsSpec"><span class="hs-identifier hs-var">dsSpec</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CoreExpr
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681187090"><span class="hs-identifier hs-var">imp_specs</span></a></span><span>
</span><span id="line-238"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187087"><span class="annot"><span class="annottext">[OrdList Binding]
</span><a href="#local-6989586621681187087"><span class="hs-identifier hs-var">spec_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187086"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187086"><span class="hs-identifier hs-var">spec_rules</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(OrdList Binding, CoreRule)] -&gt; ([OrdList Binding], [CoreRule])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(OrdList Binding, CoreRule)]
</span><a href="#local-6989586621681187089"><span class="hs-identifier hs-var">spec_prs</span></a></span><span>
</span><span id="line-239"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(OrdList Binding, [CoreRule]) -&gt; DsM (OrdList Binding, [CoreRule])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OrdList Binding] -&gt; OrdList Binding
forall a. [OrdList a] -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#concatOL"><span class="hs-identifier hs-var">concatOL</span></a></span><span> </span><span class="annot"><span class="annottext">[OrdList Binding]
</span><a href="#local-6989586621681187087"><span class="hs-identifier hs-var">spec_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187086"><span class="hs-identifier hs-var">spec_rules</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="annot"><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-type">combineEvBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- Top-level bindings can include coercion bindings, but not via superclasses</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- See Note [Top-level evidence]</span><span>
</span><span id="line-244"></span><span id="combineEvBinds"><span class="annot"><span class="annottext">combineEvBinds :: [CoreBind] -&gt; [Binding] -&gt; [CoreBind]
</span><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var hs-var">combineEvBinds</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681187083"><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187083"><span class="hs-identifier hs-var">val_prs</span></a></span></span><span>
</span><span id="line-245"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Binding] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187083"><span class="hs-identifier hs-var">val_prs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-246"></span><span class="annot"><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681187080"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187080"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681187079"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187079"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681187078"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187078"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681187077"><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187077"><span class="hs-identifier hs-var">val_prs</span></a></span></span><span>
</span><span id="line-247"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187080"><span class="hs-identifier hs-var">b</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [Binding] -&gt; [CoreBind]
</span><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187078"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187080"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187079"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">Binding -&gt; [Binding] -&gt; [Binding]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187077"><span class="hs-identifier hs-var">val_prs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187080"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187079"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; [CoreBind] -&gt; [CoreBind]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [Binding] -&gt; [CoreBind]
</span><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187078"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187077"><span class="hs-identifier hs-var">val_prs</span></a></span><span>
</span><span id="line-249"></span><span class="annot"><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681187075"><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187075"><span class="hs-identifier hs-var">prs</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681187074"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187074"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681187073"><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187073"><span class="hs-identifier hs-var">val_prs</span></a></span></span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [Binding] -&gt; [CoreBind]
</span><a href="GHC.HsToCore.html#combineEvBinds"><span class="hs-identifier hs-var">combineEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681187074"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187075"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">[Binding] -&gt; [Binding] -&gt; [Binding]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Binding]
</span><a href="#local-6989586621681187073"><span class="hs-identifier hs-var">val_prs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span class="hs-comment">{-
Note [Top-level evidence]
~~~~~~~~~~~~~~~~~~~~~~~~~
Top-level evidence bindings may be mutually recursive with the top-level value
bindings, so we must put those in a Rec.  But we can't put them *all* in a Rec
because the occurrence analyser doesn't take account of type/coercion variables
when computing dependencies.

So we pull out the type/coercion variables (which are in dependency order),
and Rec the rest.
-}</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="annot"><a href="GHC.HsToCore.html#deSugarExpr"><span class="hs-identifier hs-type">deSugarExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span id="deSugarExpr"><span class="annot"><span class="annottext">deSugarExpr :: HscEnv -&gt; LHsExpr GhcTc -&gt; IO (Messages, Maybe CoreExpr)
</span><a href="GHC.HsToCore.html#deSugarExpr"><span class="hs-identifier hs-var hs-var">deSugarExpr</span></a></span></span><span> </span><span id="local-6989586621681187072"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187072"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681187071"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187071"><span class="hs-identifier hs-var">tc_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-267"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187070"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681187070"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187072"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier hs-var">showPass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187070"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Desugar&quot;</span></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>         </span><span class="hs-comment">-- Do desugaring</span><span>
</span><span id="line-272"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187068"><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681187068"><span class="hs-identifier hs-var">msgs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187067"><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681187067"><span class="hs-identifier hs-var">mb_core_expr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; TcRn CoreExpr -&gt; IO (Messages, Maybe CoreExpr)
forall a. HscEnv -&gt; TcRn a -&gt; IO (Messages, Maybe a)
</span><a href="GHC.Tc.Module.html#runTcInteractive"><span class="hs-identifier hs-var">runTcInteractive</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681187072"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn CoreExpr -&gt; IO (Messages, Maybe CoreExpr))
-&gt; TcRn CoreExpr -&gt; IO (Messages, Maybe CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DsM CoreExpr -&gt; TcRn CoreExpr
forall a. DsM a -&gt; TcM a
</span><a href="GHC.HsToCore.Monad.html#initDsTc"><span class="hs-identifier hs-var">initDsTc</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM CoreExpr -&gt; TcRn CoreExpr) -&gt; DsM CoreExpr -&gt; TcRn CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-273"></span><span>                                 </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187071"><span class="hs-identifier hs-var">tc_expr</span></a></span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681187067"><span class="hs-identifier hs-var">mb_core_expr</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-276"></span><span>            </span><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-277"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681187064"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187064"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; FilePath -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187070"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_ds"><span class="hs-identifier hs-var">Opt_D_dump_ds</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Desugared&quot;</span></span><span>
</span><span id="line-278"></span><span>                         </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall b. OutputableBndr b =&gt; Expr b -&gt; SDoc
</span><a href="GHC.Core.Ppr.html#pprCoreExpr"><span class="hs-identifier hs-var">pprCoreExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187064"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Messages, Maybe CoreExpr) -&gt; IO (Messages, Maybe CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681187068"><span class="hs-identifier hs-var">msgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681187067"><span class="hs-identifier hs-var">mb_core_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*              Add rules and export flags to binders
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span id="local-6989586621681187521"><span class="annot"><a href="GHC.HsToCore.html#addExportFlagsAndRules"><span class="hs-identifier hs-type">addExportFlagsAndRules</span></a></span><span>
</span><span id="line-291"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HscTarget"><span class="hs-identifier hs-type">HscTarget</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NameSet"><span class="hs-identifier hs-type">NameSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NameSet"><span class="hs-identifier hs-type">NameSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-292"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681187521"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681187521"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-293"></span><span id="addExportFlagsAndRules"><span class="annot"><span class="annottext">addExportFlagsAndRules :: forall t.
HscTarget
-&gt; NameSet -&gt; NameSet -&gt; [CoreRule] -&gt; [(Id, t)] -&gt; [(Id, t)]
</span><a href="GHC.HsToCore.html#addExportFlagsAndRules"><span class="hs-identifier hs-var hs-var">addExportFlagsAndRules</span></a></span></span><span> </span><span id="local-6989586621681187059"><span class="annot"><span class="annottext">HscTarget
</span><a href="#local-6989586621681187059"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span id="local-6989586621681187058"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187058"><span class="hs-identifier hs-var">exports</span></a></span></span><span> </span><span id="local-6989586621681187057"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187057"><span class="hs-identifier hs-var">keep_alive</span></a></span></span><span> </span><span id="local-6989586621681187056"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187056"><span class="hs-identifier hs-var">rules</span></a></span></span><span> </span><span id="local-6989586621681187055"><span class="annot"><span class="annottext">[(Id, t)]
</span><a href="#local-6989586621681187055"><span class="hs-identifier hs-var">prs</span></a></span></span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Id) -&gt; [(Id, t)] -&gt; [(Id, t)]
forall a c b. (a -&gt; c) -&gt; [(a, b)] -&gt; [(c, b)]
</span><a href="GHC.Utils.Misc.html#mapFst"><span class="hs-identifier hs-var">mapFst</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id
</span><a href="#local-6989586621681187053"><span class="hs-identifier hs-var">add_one</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, t)]
</span><a href="#local-6989586621681187055"><span class="hs-identifier hs-var">prs</span></a></span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-296"></span><span>    </span><span id="local-6989586621681187053"><span class="annot"><span class="annottext">add_one :: Id -&gt; Id
</span><a href="#local-6989586621681187053"><span class="hs-identifier hs-var hs-var">add_one</span></a></span></span><span> </span><span id="local-6989586621681187052"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187052"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681187051"><span class="hs-identifier hs-var">add_rules</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187050"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681187049"><span class="hs-identifier hs-var">add_export</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187050"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187052"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>       </span><span class="hs-keyword">where</span><span>
</span><span id="line-298"></span><span>         </span><span id="local-6989586621681187050"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681187050"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187052"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span>    </span><span class="hs-comment">---------- Rules --------</span><span>
</span><span id="line-301"></span><span>        </span><span class="hs-comment">-- See Note [Attach rules to local ids]</span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-comment">-- NB: the binder might have some existing rules,</span><span>
</span><span id="line-303"></span><span>        </span><span class="hs-comment">-- arising from specialisation pragmas</span><span>
</span><span id="line-304"></span><span>    </span><span id="local-6989586621681187051"><span class="annot"><span class="annottext">add_rules :: Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681187051"><span class="hs-identifier hs-var hs-var">add_rules</span></a></span></span><span> </span><span id="local-6989586621681187047"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187047"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681187046"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187046"><span class="hs-identifier hs-var">bndr</span></a></span></span><span>
</span><span id="line-305"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681187045"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187045"><span class="hs-identifier hs-var">rules</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameEnv [CoreRule] -&gt; Name -&gt; Maybe [CoreRule]
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv [CoreRule]
</span><a href="#local-6989586621681187043"><span class="hs-identifier hs-var">rule_base</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187047"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-306"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187046"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [CoreRule] -&gt; Id
</span><a href="GHC.Core.Rules.html#addIdSpecialisations"><span class="hs-operator hs-var">`addIdSpecialisations`</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187045"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-307"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-308"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187046"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-309"></span><span>    </span><span id="local-6989586621681187043"><span class="annot"><span class="annottext">rule_base :: NameEnv [CoreRule]
</span><a href="#local-6989586621681187043"><span class="hs-identifier hs-var hs-var">rule_base</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv [CoreRule] -&gt; [CoreRule] -&gt; NameEnv [CoreRule]
</span><a href="GHC.Core.Rules.html#extendRuleBaseList"><span class="hs-identifier hs-var">extendRuleBaseList</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv [CoreRule]
</span><a href="GHC.Core.Rules.html#emptyRuleBase"><span class="hs-identifier hs-var">emptyRuleBase</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681187056"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span>    </span><span class="hs-comment">---------- Export flag --------</span><span>
</span><span id="line-312"></span><span>    </span><span class="hs-comment">-- See Note [Adding export flags]</span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621681187049"><span class="annot"><span class="annottext">add_export :: Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681187049"><span class="hs-identifier hs-var hs-var">add_export</span></a></span></span><span> </span><span id="local-6989586621681187039"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187039"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681187038"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187038"><span class="hs-identifier hs-var">bndr</span></a></span></span><span>
</span><span id="line-314"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="#local-6989586621681187037"><span class="hs-identifier hs-var">dont_discard</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187039"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id
</span><a href="GHC.Types.Id.html#setIdExported"><span class="hs-identifier hs-var">setIdExported</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187038"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-315"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681187038"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span>    </span><span class="annot"><a href="#local-6989586621681187037"><span class="hs-identifier hs-type">dont_discard</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-318"></span><span>    </span><span id="local-6989586621681187037"><span class="annot"><span class="annottext">dont_discard :: Name -&gt; Bool
</span><a href="#local-6989586621681187037"><span class="hs-identifier hs-var hs-var">dont_discard</span></a></span></span><span> </span><span id="local-6989586621681187035"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187035"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="#local-6989586621681187034"><span class="hs-identifier hs-var">is_exported</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187035"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-319"></span><span>                     </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681187035"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187057"><span class="hs-identifier hs-var">keep_alive</span></a></span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span>        </span><span class="hs-comment">-- In interactive mode, we don't want to discard any top-level</span><span>
</span><span id="line-322"></span><span>        </span><span class="hs-comment">-- entities at all (eg. do not inline them away during</span><span>
</span><span id="line-323"></span><span>        </span><span class="hs-comment">-- simplification), and retain them all in the TypeEnv so they are</span><span>
</span><span id="line-324"></span><span>        </span><span class="hs-comment">-- available from the command line.</span><span>
</span><span id="line-325"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-326"></span><span>        </span><span class="hs-comment">-- isExternalName separates the user-defined top-level names from those</span><span>
</span><span id="line-327"></span><span>        </span><span class="hs-comment">-- introduced by the type checker.</span><span>
</span><span id="line-328"></span><span>    </span><span class="annot"><a href="#local-6989586621681187034"><span class="hs-identifier hs-type">is_exported</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-329"></span><span>    </span><span id="local-6989586621681187034"><span class="annot"><span class="annottext">is_exported :: Name -&gt; Bool
</span><a href="#local-6989586621681187034"><span class="hs-identifier hs-var hs-var">is_exported</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HscTarget -&gt; Bool
</span><a href="GHC.Driver.Session.html#targetRetainsAllBindings"><span class="hs-identifier hs-var">targetRetainsAllBindings</span></a></span><span> </span><span class="annot"><span class="annottext">HscTarget
</span><a href="#local-6989586621681187059"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier hs-var">isExternalName</span></a></span><span>
</span><span id="line-330"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681187058"><span class="hs-identifier hs-var">exports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span class="hs-comment">{-
Note [Adding export flags]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Set the no-discard flag if either
        a) the Id is exported
        b) it's mentioned in the RHS of an orphan rule
        c) it's in the keep-alive set

It means that the binding won't be discarded EVEN if the binding
ends up being trivial (v = w) -- the simplifier would usually just
substitute w for v throughout, but we don't apply the substitution to
the rules (maybe we should?), so this substitution would make the rule
bogus.

You might wonder why exported Ids aren't already marked as such;
it's just because the type checker is rather busy already and
I didn't want to pass in yet another mapping.

Note [Attach rules to local ids]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Find the rules for locally-defined Ids; then we can attach them
to the binders in the top-level bindings

Reason
  - It makes the rules easier to look up
  - It means that rewrite rules and specialisations for
    locally defined Ids are handled uniformly
  - It keeps alive things that are referred to only from a rule
    (the occurrence analyser knows about rules attached to Ids)
  - It makes sure that, when we apply a rule, the free vars
    of the RHS are more likely to be in scope
  - The imported rules are carried in the in-scope set
    which is extended on each iteration by the new wave of
    local binders; any rules which aren't on the binding will
    thereby get dropped


************************************************************************
*                                                                      *
*              Desugaring rewrite rules
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="annot"><a href="GHC.HsToCore.html#dsRule"><span class="hs-identifier hs-type">dsRule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Decls.html#LRuleDecl"><span class="hs-identifier hs-type">LRuleDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span id="dsRule"><span class="annot"><span class="annottext">dsRule :: LRuleDecl GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
</span><a href="GHC.HsToCore.html#dsRule"><span class="hs-identifier hs-var hs-var">dsRule</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681187028"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681187028"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#HsRule"><span class="hs-identifier hs-type">HsRule</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">rd_name :: forall pass. RuleDecl pass -&gt; Located (SourceText, FastString)
</span><a href="GHC.Hs.Decls.html#rd_name"><span class="hs-identifier hs-var">rd_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187025"><span class="annot"><span class="annottext">Located (SourceText, FastString)
</span><a href="#local-6989586621681187025"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-378"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">rd_act :: forall pass. RuleDecl pass -&gt; Activation
</span><a href="GHC.Hs.Decls.html#rd_act"><span class="hs-identifier hs-var">rd_act</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187023"><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681187023"><span class="hs-identifier hs-var">rule_act</span></a></span></span><span>
</span><span id="line-379"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">rd_tmvs :: forall pass. RuleDecl pass -&gt; [LRuleBndr pass]
</span><a href="GHC.Hs.Decls.html#rd_tmvs"><span class="hs-identifier hs-var">rd_tmvs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187021"><span class="annot"><span class="annottext">[LRuleBndr GhcTc]
</span><a href="#local-6989586621681187021"><span class="hs-identifier hs-var">vars</span></a></span></span><span>
</span><span id="line-380"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">rd_lhs :: forall pass. RuleDecl pass -&gt; Located (HsExpr pass)
</span><a href="GHC.Hs.Decls.html#rd_lhs"><span class="hs-identifier hs-var">rd_lhs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187019"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187019"><span class="hs-identifier hs-var">lhs</span></a></span></span><span>
</span><span id="line-381"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">rd_rhs :: forall pass. RuleDecl pass -&gt; Located (HsExpr pass)
</span><a href="GHC.Hs.Decls.html#rd_rhs"><span class="hs-identifier hs-var">rd_rhs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681187017"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187017"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681187028"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-383"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681187015"><span class="annot"><span class="annottext">bndrs' :: [Id]
</span><a href="#local-6989586621681187015"><span class="hs-identifier hs-var hs-var">bndrs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681187014"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#RuleBndr"><span class="hs-identifier hs-type">RuleBndr</span></a></span><span> </span><span class="annot"><span class="annottext">XCRuleBndr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681187014"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681187014"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LRuleBndr GhcTc]
</span><a href="#local-6989586621681187021"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187012"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187012"><span class="hs-identifier hs-var">lhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall gbl lcl a.
GeneralFlag -&gt; TcRnIf gbl lcl a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#unsetGOptM"><span class="hs-identifier hs-var">unsetGOptM</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_EnableRewriteRules"><span class="hs-identifier hs-var">Opt_EnableRewriteRules</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM CoreExpr -&gt; DsM CoreExpr) -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-386"></span><span>                  </span><span class="annot"><span class="annottext">WarningFlag -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall gbl lcl a.
WarningFlag -&gt; TcRnIf gbl lcl a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#unsetWOptM"><span class="hs-identifier hs-var">unsetWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnIdentities"><span class="hs-identifier hs-var">Opt_WarnIdentities</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM CoreExpr -&gt; DsM CoreExpr) -&gt; DsM CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-387"></span><span>                  </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187019"><span class="hs-identifier hs-var">lhs</span></a></span><span>   </span><span class="hs-comment">-- Note [Desugaring RULE left hand sides]</span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187007"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187007"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681187017"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-390"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187006"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187006"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681187004"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681187004"><span class="hs-identifier hs-var">bndrs''</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187003"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187003"><span class="hs-identifier hs-var">lhs''</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681187002"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187002"><span class="hs-identifier hs-var">rhs''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr -&gt; DsM ([Id], CoreExpr, CoreExpr)
</span><a href="GHC.HsToCore.html#unfold_coerce"><span class="hs-identifier hs-var">unfold_coerce</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681187015"><span class="hs-identifier hs-var">bndrs'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187012"><span class="hs-identifier hs-var">lhs'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187007"><span class="hs-identifier hs-var">rhs'</span></a></span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span>        </span><span class="hs-comment">-- Substitute the dict bindings eagerly,</span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-comment">-- and take the body apart into a (f args) form</span><span>
</span><span id="line-396"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681187000"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187000"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-397"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [Id] -&gt; CoreExpr -&gt; Either SDoc ([Id], Id, [CoreExpr])
</span><a href="GHC.HsToCore.Binds.html#decomposeRuleLhs"><span class="hs-identifier hs-var">decomposeRuleLhs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187000"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681187004"><span class="hs-identifier hs-var">bndrs''</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187003"><span class="hs-identifier hs-var">lhs''</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-398"></span><span>                </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681186997"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681186997"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681186997"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe CoreRule -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CoreRule
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-399"></span><span>                </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681186994"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186994"><span class="hs-identifier hs-var">final_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186993"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186993"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186992"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681186992"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681186991"><span class="annot"><span class="annottext">is_local :: Bool
</span><a href="#local-6989586621681186991"><span class="hs-identifier hs-var hs-var">is_local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isLocalId"><span class="hs-identifier hs-var">isLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186993"><span class="hs-identifier hs-var">fn_id</span></a></span><span>
</span><span id="line-402"></span><span>                </span><span class="hs-comment">-- NB: isLocalId is False of implicit Ids.  This is good because</span><span>
</span><span id="line-403"></span><span>                </span><span class="hs-comment">-- we don't want to attach rules to the bindings of implicit Ids,</span><span>
</span><span id="line-404"></span><span>                </span><span class="hs-comment">-- because they don't show up in the bindings until just before code gen</span><span>
</span><span id="line-405"></span><span>              </span><span id="local-6989586621681186989"><span class="annot"><span class="annottext">fn_name :: Name
</span><a href="#local-6989586621681186989"><span class="hs-identifier hs-var hs-var">fn_name</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186993"><span class="hs-identifier hs-var">fn_id</span></a></span><span>
</span><span id="line-406"></span><span>              </span><span id="local-6989586621681186988"><span class="annot"><span class="annottext">final_rhs :: CoreExpr
</span><a href="#local-6989586621681186988"><span class="hs-identifier hs-var hs-var">final_rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; DynFlags -&gt; CoreExpr -&gt; CoreExpr
DynFlags -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.SimpleOpt.html#simpleOptExpr"><span class="hs-identifier hs-var">simpleOptExpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187000"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681187002"><span class="hs-identifier hs-var">rhs''</span></a></span><span>    </span><span class="hs-comment">-- De-crap it</span><span>
</span><span id="line-407"></span><span>              </span><span id="local-6989586621681186987"><span class="annot"><span class="annottext">rule_name :: FastString
</span><a href="#local-6989586621681186987"><span class="hs-identifier hs-var hs-var">rule_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SourceText, FastString) -&gt; FastString
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (SourceText, FastString) -&gt; (SourceText, FastString)
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (SourceText, FastString)
</span><a href="#local-6989586621681187025"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>              </span><span id="local-6989586621681186985"><span class="annot"><span class="annottext">final_bndrs_set :: VarSet
</span><a href="#local-6989586621681186985"><span class="hs-identifier hs-var hs-var">final_bndrs_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186994"><span class="hs-identifier hs-var">final_bndrs</span></a></span><span>
</span><span id="line-409"></span><span>              </span><span id="local-6989586621681186983"><span class="annot"><span class="annottext">arg_ids :: [Id]
</span><a href="#local-6989586621681186983"><span class="hs-identifier hs-var hs-var">arg_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681186985"><span class="hs-identifier hs-var">final_bndrs_set</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; [Id]) -&gt; [Id] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-410"></span><span>                        </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [CoreExpr] -&gt; [Id]
</span><a href="GHC.Core.FVs.html#exprsSomeFreeVarsList"><span class="hs-identifier hs-var">exprsSomeFreeVarsList</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681186992"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681186980"><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186980"><span class="hs-identifier hs-var">rule</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; Bool
-&gt; FastString
-&gt; Activation
-&gt; Name
-&gt; [Id]
-&gt; [CoreExpr]
-&gt; CoreExpr
-&gt; DsM CoreRule
</span><a href="GHC.HsToCore.Binds.html#dsMkUserRule"><span class="hs-identifier hs-var">dsMkUserRule</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681187006"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681186991"><span class="hs-identifier hs-var">is_local</span></a></span><span>
</span><span id="line-413"></span><span>                         </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681186987"><span class="hs-identifier hs-var">rule_name</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681187023"><span class="hs-identifier hs-var">rule_act</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681186989"><span class="hs-identifier hs-var">fn_name</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186994"><span class="hs-identifier hs-var">final_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681186992"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-414"></span><span>                         </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186988"><span class="hs-identifier hs-var">final_rhs</span></a></span><span>
</span><span id="line-415"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DsM () -&gt; DsM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnInlineRuleShadowing"><span class="hs-identifier hs-var">Opt_WarnInlineRuleShadowing</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681187000"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-416"></span><span>          </span><span class="annot"><span class="annottext">FastString -&gt; Activation -&gt; Id -&gt; [Id] -&gt; DsM ()
</span><a href="GHC.HsToCore.html#warnRuleShadowing"><span class="hs-identifier hs-var">warnRuleShadowing</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681186987"><span class="hs-identifier hs-var">rule_name</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681187023"><span class="hs-identifier hs-var">rule_act</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186993"><span class="hs-identifier hs-var">fn_id</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186983"><span class="hs-identifier hs-var">arg_ids</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe CoreRule -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Maybe CoreRule)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreRule -&gt; Maybe CoreRule
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186980"><span class="hs-identifier hs-var">rule</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>        </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="annot"><a href="GHC.HsToCore.html#warnRuleShadowing"><span class="hs-identifier hs-type">warnRuleShadowing</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RuleName"><span class="hs-identifier hs-type">RuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Activation"><span class="hs-identifier hs-type">Activation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- See Note [Rules and inlining/other rules]</span><span>
</span><span id="line-423"></span><span id="warnRuleShadowing"><span class="annot"><span class="annottext">warnRuleShadowing :: FastString -&gt; Activation -&gt; Id -&gt; [Id] -&gt; DsM ()
</span><a href="GHC.HsToCore.html#warnRuleShadowing"><span class="hs-identifier hs-var hs-var">warnRuleShadowing</span></a></span></span><span> </span><span id="local-6989586621681186974"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681186974"><span class="hs-identifier hs-var">rule_name</span></a></span></span><span> </span><span id="local-6989586621681186973"><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681186973"><span class="hs-identifier hs-var">rule_act</span></a></span></span><span> </span><span id="local-6989586621681186972"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186972"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span> </span><span id="local-6989586621681186971"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186971"><span class="hs-identifier hs-var">arg_ids</span></a></span></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Id -&gt; DsM ()
</span><a href="#local-6989586621681186970"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186972"><span class="hs-identifier hs-var">fn_id</span></a></span><span>    </span><span class="hs-comment">-- We often have multiple rules for the same Id in a</span><span>
</span><span id="line-425"></span><span>                              </span><span class="hs-comment">-- module. Maybe we should check that they don't overlap</span><span>
</span><span id="line-426"></span><span>                              </span><span class="hs-comment">-- but currently we don't</span><span>
</span><span id="line-427"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; DsM ()) -&gt; [Id] -&gt; DsM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Id -&gt; DsM ()
</span><a href="#local-6989586621681186970"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186971"><span class="hs-identifier hs-var">arg_ids</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-428"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-429"></span><span>    </span><span id="local-6989586621681186970"><span class="annot"><span class="annottext">check :: Bool -&gt; Id -&gt; DsM ()
</span><a href="#local-6989586621681186970"><span class="hs-identifier hs-var hs-var">check</span></a></span></span><span> </span><span id="local-6989586621681186968"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681186968"><span class="hs-identifier hs-var">check_rules_too</span></a></span></span><span> </span><span id="local-6989586621681186967"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span></span><span>
</span><span id="line-430"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isLocalId"><span class="hs-identifier hs-var">isLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Unfolding -&gt; Bool
</span><a href="GHC.Core.html#canUnfold"><span class="hs-identifier hs-var">canUnfold</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Unfolding
</span><a href="GHC.Types.Id.html#idUnfolding"><span class="hs-identifier hs-var">idUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span>                       </span><span class="hs-comment">-- If imported with no unfolding, no worries</span><span>
</span><span id="line-432"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Activation
</span><a href="GHC.Types.Id.html#idInlineActivation"><span class="hs-identifier hs-var">idInlineActivation</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Activation -&gt; Bool
</span><a href="GHC.Types.Basic.html#competesWith"><span class="hs-operator hs-var">`competesWith`</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681186973"><span class="hs-identifier hs-var">rule_act</span></a></span><span>
</span><span id="line-433"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnInlineRuleShadowing"><span class="hs-identifier hs-var">Opt_WarnInlineRuleShadowing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-434"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Rule&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Types.Basic.html#pprRuleName"><span class="hs-identifier hs-var">pprRuleName</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681186974"><span class="hs-identifier hs-var">rule_name</span></a></span><span>
</span><span id="line-435"></span><span>                               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;may never fire&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>                            </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;because&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>                               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;might inline first&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Probable fix: add an INLINE[n] or NOINLINE[n] pragma for&quot;</span></span><span>
</span><span id="line-439"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#whenPprDebug"><span class="hs-identifier hs-var">whenPprDebug</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Activation -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Activation
</span><a href="GHC.Types.Id.html#idInlineActivation"><span class="hs-identifier hs-var">idInlineActivation</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681186973"><span class="hs-identifier hs-var">rule_act</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681186968"><span class="hs-identifier hs-var">check_rules_too</span></a></span><span>
</span><span id="line-443"></span><span>      </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186955"><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186955"><span class="hs-identifier hs-var">bad_rule</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; [CoreRule]
</span><a href="#local-6989586621681186954"><span class="hs-identifier hs-var">get_bad_rules</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span>
</span><span id="line-444"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnInlineRuleShadowing"><span class="hs-identifier hs-var">Opt_WarnInlineRuleShadowing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Rule&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Types.Basic.html#pprRuleName"><span class="hs-identifier hs-var">pprRuleName</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681186974"><span class="hs-identifier hs-var">rule_name</span></a></span><span>
</span><span id="line-446"></span><span>                               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;may never fire&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>                            </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;because rule&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Types.Basic.html#pprRuleName"><span class="hs-identifier hs-var">pprRuleName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreRule -&gt; FastString
</span><a href="GHC.Core.html#ruleName"><span class="hs-identifier hs-var">ruleName</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186955"><span class="hs-identifier hs-var">bad_rule</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-448"></span><span>                               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;for&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186967"><span class="hs-identifier hs-var">lhs_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span>                               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;might fire first&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Probable fix: add phase [n] or [~n] to the competing rule&quot;</span></span><span>
</span><span id="line-451"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#whenPprDebug"><span class="hs-identifier hs-var">whenPprDebug</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreRule -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186955"><span class="hs-identifier hs-var">bad_rule</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-454"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>
</span><span id="line-456"></span><span>    </span><span id="local-6989586621681186954"><span class="annot"><span class="annottext">get_bad_rules :: Id -&gt; [CoreRule]
</span><a href="#local-6989586621681186954"><span class="hs-identifier hs-var hs-var">get_bad_rules</span></a></span></span><span> </span><span id="local-6989586621681186952"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186952"><span class="hs-identifier hs-var">lhs_id</span></a></span></span><span>
</span><span id="line-457"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186951"><span class="hs-identifier hs-var">rule</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681186951"><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186951"><span class="hs-identifier hs-var">rule</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; [CoreRule]
</span><a href="GHC.Types.Id.html#idCoreRules"><span class="hs-identifier hs-var">idCoreRules</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186952"><span class="hs-identifier hs-var">lhs_id</span></a></span><span>
</span><span id="line-458"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreRule -&gt; Activation
</span><a href="GHC.Core.html#ruleActivation"><span class="hs-identifier hs-var">ruleActivation</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681186951"><span class="hs-identifier hs-var">rule</span></a></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Activation -&gt; Bool
</span><a href="GHC.Types.Basic.html#competesWith"><span class="hs-operator hs-var">`competesWith`</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681186973"><span class="hs-identifier hs-var">rule_act</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-459"></span><span>
</span><span id="line-460"></span><span class="hs-comment">-- See Note [Desugaring coerce as cast]</span><span>
</span><span id="line-461"></span><span class="annot"><a href="GHC.HsToCore.html#unfold_coerce"><span class="hs-identifier hs-type">unfold_coerce</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span id="unfold_coerce"><span class="annot"><span class="annottext">unfold_coerce :: [Id] -&gt; CoreExpr -&gt; CoreExpr -&gt; DsM ([Id], CoreExpr, CoreExpr)
</span><a href="GHC.HsToCore.html#unfold_coerce"><span class="hs-identifier hs-var hs-var">unfold_coerce</span></a></span></span><span> </span><span id="local-6989586621681186947"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186947"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621681186946"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186946"><span class="hs-identifier hs-var">lhs</span></a></span></span><span> </span><span id="local-6989586621681186945"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186945"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-463"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681186944"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186944"><span class="hs-identifier hs-var">bndrs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186943"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186943"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
</span><a href="#local-6989586621681186942"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186947"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-464"></span><span>    </span><span class="annot"><span class="annottext">([Id], CoreExpr, CoreExpr) -&gt; DsM ([Id], CoreExpr, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186944"><span class="hs-identifier hs-var">bndrs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186943"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186946"><span class="hs-identifier hs-var">lhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186943"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186945"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-466"></span><span>    </span><span class="annot"><a href="#local-6989586621681186942"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span>    </span><span id="local-6989586621681186942"><span class="annot"><span class="annottext">go :: [Id] -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
</span><a href="#local-6989586621681186942"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id], CoreExpr -&gt; CoreExpr) -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>    </span><span class="annot"><a href="#local-6989586621681186942"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681186940"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186940"><span class="hs-identifier hs-var">v</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681186939"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186939"><span class="hs-identifier hs-var">vs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681186938"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681186938"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681186937"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186937"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186936"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186936"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186935"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186935"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Maybe (TyCon, [Type])
Type -&gt; Maybe (TyCon, [Type])
</span><a href="GHC.Core.Type.html#splitTyConApp_maybe"><span class="hs-identifier hs-var">splitTyConApp_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186940"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681186938"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#coercibleTyConKey"><span class="hs-identifier hs-var">coercibleTyConKey</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-471"></span><span>            </span><span id="local-6989586621681186930"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681186930"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv Unique
forall gbl lcl. TcRnIf gbl lcl Unique
</span><a href="GHC.Tc.Utils.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-472"></span><span>
</span><span id="line-473"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681186928"><span class="annot"><span class="annottext">ty' :: Type
</span><a href="#local-6989586621681186928"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#eqReprPrimTyCon"><span class="hs-identifier hs-var">eqReprPrimTyCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186937"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186937"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186936"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186935"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-474"></span><span>                </span><span id="local-6989586621681186925"><span class="annot"><span class="annottext">v' :: Id
</span><a href="#local-6989586621681186925"><span class="hs-identifier hs-var hs-var">v'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalCoVar"><span class="hs-identifier hs-var">mkLocalCoVar</span></a></span><span>
</span><span id="line-475"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(OccName -&gt; OccName) -&gt; Unique -&gt; Name -&gt; Name
</span><a href="GHC.Types.Name.html#mkDerivedInternalName"><span class="hs-identifier hs-var">mkDerivedInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkRepEqOcc"><span class="hs-identifier hs-var">mkRepEqOcc</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681186930"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186940"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186928"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-476"></span><span>                </span><span id="local-6989586621681186920"><span class="annot"><span class="annottext">box :: CoreExpr
</span><a href="#local-6989586621681186920"><span class="hs-identifier hs-var hs-var">box</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Id
</span><a href="GHC.Core.DataCon.html#dataConWrapId"><span class="hs-identifier hs-var">dataConWrapId</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#coercibleDataCon"><span class="hs-identifier hs-var">coercibleDataCon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-operator hs-var">`mkTyApps`</span></a></span><span>
</span><span id="line-477"></span><span>                      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186937"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186936"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186935"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-operator hs-var">`App`</span></a></span><span>
</span><span id="line-478"></span><span>                      </span><span class="annot"><span class="annottext">Coercion -&gt; CoreExpr
forall b. Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-var">Coercion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkCoVarCo"><span class="hs-identifier hs-var">mkCoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186925"><span class="hs-identifier hs-var">v'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681186913"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186913"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186912"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186912"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
</span><a href="#local-6989586621681186942"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186939"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-481"></span><span>            </span><span class="annot"><span class="annottext">([Id], CoreExpr -&gt; CoreExpr) -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186925"><span class="hs-identifier hs-var">v'</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186913"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-var">mkCoreLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186940"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186920"><span class="hs-identifier hs-var">box</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr)
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186912"><span class="hs-identifier hs-var">wrap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-482"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-483"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681186909"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186909"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681186908"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186908"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
</span><a href="#local-6989586621681186942"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186939"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-484"></span><span>            </span><span class="annot"><span class="annottext">([Id], CoreExpr -&gt; CoreExpr) -&gt; DsM ([Id], CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186940"><span class="hs-identifier hs-var">v</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681186909"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681186908"><span class="hs-identifier hs-var">wrap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>
</span><span id="line-486"></span><span class="hs-comment">{- Note [Desugaring RULE left hand sides]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For the LHS of a RULE we do *not* want to desugar
    [x]   to    build (\cn. x `c` n)
We want to leave explicit lists simply as chains
of cons's. We can achieve that slightly indirectly by
switching off EnableRewriteRules.  See GHC.HsToCore.Expr.dsExplicitList.

That keeps the desugaring of list comprehensions simple too.

Nor do we want to warn of conversion identities on the LHS;
the rule is precisely to optimise them:
  {-# RULES &quot;fromRational/id&quot; fromRational = id :: Rational -&gt; Rational #-}

Note [Desugaring coerce as cast]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We want the user to express a rule saying roughly &#8220;mapping a coercion over a
list can be replaced by a coercion&#8221;. But the cast operator of Core (&#9655;) cannot
be written in Haskell. So we use `coerce` for that (#2110). The user writes
    map coerce = coerce
as a RULE, and this optimizes any kind of mapped' casts away, including `map
MkNewtype`.

For that we replace any forall'ed `c :: Coercible a b` value in a RULE by
corresponding `co :: a ~#R b` and wrap the LHS and the RHS in
`let c = MkCoercible co in ...`. This is later simplified to the desired form
by simpleOptExpr (for the LHS) resp. the simplifiers (for the RHS).
See also Note [Getting the map/coerce RULE to work] in GHC.Core.SimpleOpt.

Note [Rules and inlining/other rules]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you have
  f x = ...
  g x = ...
  {-# RULES &quot;rule-for-f&quot; forall x. f (g x) = ... #-}
then there's a good chance that in a potential rule redex
    ...f (g e)...
then 'f' or 'g' will inline before the rule can fire.  Solution: add an
INLINE [n] or NOINLINE [n] pragma to 'f' and 'g'.

Note that this applies to all the free variables on the LHS, both the
main function and things in its arguments.

We also check if there are Ids on the LHS that have competing RULES.
In the above example, suppose we had
  {-# RULES &quot;rule-for-g&quot; forally. g [y] = ... #-}
Then &quot;rule-for-f&quot; and &quot;rule-for-g&quot; would compete.  Better to add phase
control, so &quot;rule-for-f&quot; has a chance to fire before &quot;rule-for-g&quot; becomes
active; or perhaps after &quot;rule-for-g&quot; has become inactive. This is checked
by 'competesWith'

Class methods have a built-in RULE to select the method from the dictionary,
so you can't change the phase on this.  That makes id very dubious to
match on class methods in RULE lhs's.   See #10595.   I'm not happy
about this. For example in Control.Arrow we have

{-# RULES &quot;compose/arr&quot;   forall f g .
                          (arr f) . (arr g) = arr (f . g) #-}

and similar, which will elicit exactly these warnings, and risk never
firing.  But it's not clear what to do instead.  We could make the
class method rules inactive in phase 2, but that would delay when
subsequent transformations could fire.
-}</span><span>
</span><span id="line-550"></span><span>
</span><span id="line-551"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*              Magic definitions
*                                                                      *
************************************************************************

Note [Patching magic definitions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We sometimes need to have access to defined Ids in pure contexts. Usually, we
simply &quot;wire in&quot; these entities, as we do for types in GHC.Builtin.Types and for Ids
in GHC.Types.Id.Make. See Note [Wired-in Ids] in GHC.Types.Id.Make.

However, it is sometimes *much* easier to define entities in Haskell,
even if we need pure access; note that wiring-in an Id requires all
entities used in its definition *also* to be wired in, transitively
and recursively.  This can be a huge pain.  The little trick
documented here allows us to have the best of both worlds.

Motivating example: unsafeCoerce#. See [Wiring in unsafeCoerce#] for the
details.

The trick is to

* Define the known-key Id in a library module, with a stub definition,
     unsafeCoerce# :: ..a suitable type signature..
     unsafeCoerce# = error &quot;urk&quot;

* Magically over-write its RHS here in the desugarer, in
  patchMagicDefns.  This update can be done with full access to the
  DsM monad, and hence, dsLookupGlobal. We thus do not have to wire in
  all the entities used internally, a potentially big win.

  This step should not change the Name or type of the Id.

Because an Id stores its unfolding directly (as opposed to in the second
component of a (Id, CoreExpr) pair), the patchMagicDefns function returns
a new Id to use.

Here are the moving parts:

- patchMagicDefns checks whether we're in a module with magic definitions;
  if so, patch the magic definitions. If not, skip.

- patchMagicDefn just looks up in an environment to find a magic defn and
  patches it in.

- magicDefns holds the magic definitions.

- magicDefnsEnv allows for quick access to magicDefns.

- magicDefnModules, built also from magicDefns, contains the modules that
  need careful attention.

Note [Wiring in unsafeCoerce#]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We want (Haskell)

  unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
                          (a :: TYPE r1) (b :: TYPE r2).
                   a -&gt; b
  unsafeCoerce# x = case unsafeEqualityProof @r1 @r2 of
    UnsafeRefl -&gt; case unsafeEqualityProof @a @b of
      UnsafeRefl -&gt; x

or (Core)

  unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
                          (a :: TYPE r1) (b :: TYPE r2).
                   a -&gt; b
  unsafeCoerce# = \ @r1 @r2 @a @b (x :: a).
    case unsafeEqualityProof @RuntimeRep @r1 @r2 of
      UnsafeRefl (co1 :: r1 ~# r2) -&gt;
        case unsafeEqualityProof @(TYPE r2) @(a |&gt; TYPE co1) @b of
          UnsafeRefl (co2 :: (a |&gt; TYPE co1) ~# b) -&gt;
            (x |&gt; (GRefl :: a ~# (a |&gt; TYPE co1)) ; co2)

It looks like we can write this in Haskell directly, but we can't:
the levity polymorphism checks defeat us. Note that `x` is a levity-
polymorphic variable. So we must wire it in with a compulsory
unfolding, like other levity-polymorphic primops.

The challenge is that UnsafeEquality is a GADT, and wiring in a GADT
is *hard*: it has a worker separate from its wrapper, with all manner
of complications. (Simon and Richard tried to do this. We nearly wept.)

The solution is documented in Note [Patching magic definitions]. We now
simply look up the UnsafeEquality GADT in the environment, leaving us
only to wire in unsafeCoerce# directly.

Wrinkle: see Note [Always expose compulsory unfoldings] in GHC.Iface.Tidy
-}</span><span>
</span><span id="line-643"></span><span>
</span><span id="line-644"></span><span>
</span><span id="line-645"></span><span class="hs-comment">-- Postcondition: the returned Ids are in one-to-one correspondence as the</span><span>
</span><span id="line-646"></span><span class="hs-comment">-- input Ids; each returned Id has the same type as the passed-in Id.</span><span>
</span><span id="line-647"></span><span class="hs-comment">-- See Note [Patching magic definitions]</span><span>
</span><span id="line-648"></span><span class="annot"><a href="GHC.HsToCore.html#patchMagicDefns"><span class="hs-identifier hs-type">patchMagicDefns</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-649"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span id="patchMagicDefns"><span class="annot"><span class="annottext">patchMagicDefns :: OrdList Binding -&gt; DsM (OrdList Binding)
</span><a href="GHC.HsToCore.html#patchMagicDefns"><span class="hs-identifier hs-var hs-var">patchMagicDefns</span></a></span></span><span> </span><span id="local-6989586621681186907"><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681186907"><span class="hs-identifier hs-var">pairs</span></a></span></span><span>
</span><span id="line-651"></span><span>  </span><span class="hs-comment">-- optimization: check whether we're in a magic module before looking</span><span>
</span><span id="line-652"></span><span>  </span><span class="hs-comment">-- at all the ids</span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681186906"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681186906"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-654"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681186906"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; ModuleSet -&gt; Bool
</span><a href="GHC.Unit.Module.Env.html#elemModuleSet"><span class="hs-operator hs-var">`elemModuleSet`</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSet
</span><a href="GHC.HsToCore.html#magicDefnModules"><span class="hs-identifier hs-var">magicDefnModules</span></a></span><span>
</span><span id="line-655"></span><span>         </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
-&gt; OrdList Binding -&gt; DsM (OrdList Binding)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="GHC.HsToCore.html#patchMagicDefn"><span class="hs-identifier hs-var">patchMagicDefn</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681186907"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-656"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">OrdList Binding -&gt; DsM (OrdList Binding)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList Binding
</span><a href="#local-6989586621681186907"><span class="hs-identifier hs-var">pairs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span class="annot"><a href="GHC.HsToCore.html#patchMagicDefn"><span class="hs-identifier hs-type">patchMagicDefn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span id="patchMagicDefn"><span class="annot"><span class="annottext">patchMagicDefn :: Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="GHC.HsToCore.html#patchMagicDefn"><span class="hs-identifier hs-var hs-var">patchMagicDefn</span></a></span></span><span> </span><span id="local-6989586621681186901"><span class="annot"><span class="annottext">orig_pair :: Binding
</span><a href="#local-6989586621681186901"><span class="hs-identifier hs-var">orig_pair</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681186900"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186900"><span class="hs-identifier hs-var">orig_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186899"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186899"><span class="hs-identifier hs-var">orig_rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-660"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681186898"><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="#local-6989586621681186898"><span class="hs-identifier hs-var">mk_magic_pair</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameEnv (Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
-&gt; Name
-&gt; Maybe (Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
</span><a href="GHC.HsToCore.html#magicDefnsEnv"><span class="hs-identifier hs-var">magicDefnsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186900"><span class="hs-identifier hs-var">orig_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-661"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681186896"><span class="annot"><span class="annottext">magic_pair :: Binding
</span><a href="#local-6989586621681186896"><span class="hs-identifier hs-var">magic_pair</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681186895"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186895"><span class="hs-identifier hs-var">magic_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="#local-6989586621681186898"><span class="hs-identifier hs-var">mk_magic_pair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186900"><span class="hs-identifier hs-var">orig_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186899"><span class="hs-identifier hs-var">orig_rhs</span></a></span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span>       </span><span class="hs-comment">-- Patching should not change the Name or the type of the Id</span><span>
</span><span id="line-664"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">getUnique</span><span> </span><span class="hs-identifier">magic_id</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">getUnique</span><span> </span><span class="hs-identifier">orig_id</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-665"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">varType</span><span> </span><span class="hs-identifier">magic_id</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">eqType</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">varType</span><span> </span><span class="hs-identifier">orig_id</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Binding
</span><a href="#local-6989586621681186896"><span class="hs-identifier hs-var">magic_pair</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-668"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-669"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Binding
</span><a href="#local-6989586621681186901"><span class="hs-identifier hs-var">orig_pair</span></a></span><span>
</span><span id="line-670"></span><span>
</span><span id="line-671"></span><span class="annot"><a href="GHC.HsToCore.html#magicDefns"><span class="hs-identifier hs-type">magicDefns</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>    </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- old Id and RHS</span><span>
</span><span id="line-672"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- new Id and RHS</span><span>
</span><span id="line-673"></span><span>               </span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-674"></span><span id="magicDefns"><span class="annot"><span class="annottext">magicDefns :: [(Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)]
</span><a href="GHC.HsToCore.html#magicDefns"><span class="hs-identifier hs-var hs-var">magicDefns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unsafeCoercePrimName"><span class="hs-identifier hs-var">unsafeCoercePrimName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="GHC.HsToCore.html#mkUnsafeCoercePrimPair"><span class="hs-identifier hs-var">mkUnsafeCoercePrimPair</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-675"></span><span>
</span><span id="line-676"></span><span class="annot"><a href="GHC.HsToCore.html#magicDefnsEnv"><span class="hs-identifier hs-type">magicDefnsEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-677"></span><span id="magicDefnsEnv"><span class="annot"><span class="annottext">magicDefnsEnv :: NameEnv (Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
</span><a href="GHC.HsToCore.html#magicDefnsEnv"><span class="hs-identifier hs-var hs-var">magicDefnsEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)]
-&gt; NameEnv
     (Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)]
</span><a href="GHC.HsToCore.html#magicDefns"><span class="hs-identifier hs-var">magicDefns</span></a></span><span>
</span><span id="line-678"></span><span>
</span><span id="line-679"></span><span class="annot"><a href="GHC.HsToCore.html#magicDefnModules"><span class="hs-identifier hs-type">magicDefnModules</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Env.html#ModuleSet"><span class="hs-identifier hs-type">ModuleSet</span></a></span><span>
</span><span id="line-680"></span><span id="magicDefnModules"><span class="annot"><span class="annottext">magicDefnModules :: ModuleSet
</span><a href="GHC.HsToCore.html#magicDefnModules"><span class="hs-identifier hs-var hs-var">magicDefnModules</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Module] -&gt; ModuleSet
</span><a href="GHC.Unit.Module.Env.html#mkModuleSet"><span class="hs-identifier hs-var">mkModuleSet</span></a></span><span> </span><span class="annot"><span class="annottext">([Module] -&gt; ModuleSet) -&gt; [Module] -&gt; ModuleSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
 -&gt; Module)
-&gt; [(Name,
     Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)]
-&gt; [Module]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Module
Name -&gt; Module
</span><a href="GHC.Types.Name.html#nameModule"><span class="hs-identifier hs-var">nameModule</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Module)
-&gt; ((Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
    -&gt; Name)
-&gt; (Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
-&gt; Module
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Name)
-&gt; ((Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
    -&gt; Name)
-&gt; (Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
-&gt; Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)
-&gt; Name
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Name, Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding)]
</span><a href="GHC.HsToCore.html#magicDefns"><span class="hs-identifier hs-var">magicDefns</span></a></span><span>
</span><span id="line-681"></span><span>
</span><span id="line-682"></span><span class="annot"><a href="GHC.HsToCore.html#mkUnsafeCoercePrimPair"><span class="hs-identifier hs-type">mkUnsafeCoercePrimPair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-683"></span><span class="hs-comment">-- See Note [Wiring in unsafeCoerce#] for the defn we are creating here</span><span>
</span><span id="line-684"></span><span id="mkUnsafeCoercePrimPair"><span class="annot"><span class="annottext">mkUnsafeCoercePrimPair :: Id -&gt; CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
</span><a href="GHC.HsToCore.html#mkUnsafeCoercePrimPair"><span class="hs-identifier hs-var hs-var">mkUnsafeCoercePrimPair</span></a></span></span><span> </span><span id="local-6989586621681186885"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186885"><span class="hs-identifier hs-var">_old_id</span></a></span></span><span> </span><span id="local-6989586621681186884"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186884"><span class="hs-identifier hs-var">old_expr</span></a></span></span><span>
</span><span id="line-685"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681186883"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186883"><span class="hs-identifier hs-var">unsafe_equality_proof_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unsafeEqualityProofName"><span class="hs-identifier hs-var">unsafeEqualityProofName</span></a></span><span>
</span><span id="line-686"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681186880"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681186880"><span class="hs-identifier hs-var">unsafe_equality_tc</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM TyCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupTyCon"><span class="hs-identifier hs-var">dsLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unsafeEqualityTyConName"><span class="hs-identifier hs-var">unsafeEqualityTyConName</span></a></span><span>
</span><span id="line-687"></span><span>
</span><span id="line-688"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681186877"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681186877"><span class="hs-identifier hs-var">unsafe_refl_data_con</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681186880"><span class="hs-identifier hs-var">unsafe_equality_tc</span></a></span><span>
</span><span id="line-689"></span><span>
</span><span id="line-690"></span><span>             </span><span id="local-6989586621681186876"><span class="annot"><span class="annottext">rhs :: CoreExpr
</span><a href="#local-6989586621681186876"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep1TyVar"><span class="hs-identifier hs-var">runtimeRep1TyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep2TyVar"><span class="hs-identifier hs-var">runtimeRep2TyVar</span></a></span><span>
</span><span id="line-691"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTyVar"><span class="hs-identifier hs-var">openAlphaTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#openBetaTyVar"><span class="hs-identifier hs-var">openBetaTyVar</span></a></span><span>
</span><span id="line-692"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186870"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-693"></span><span>                   </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#mkSingleAltCase"><span class="hs-identifier hs-var">mkSingleAltCase</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186868"><span class="hs-identifier hs-var">scrut1</span></a></span><span>
</span><span id="line-694"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186865"><span class="hs-identifier hs-var">scrut1_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681186877"><span class="hs-identifier hs-var">unsafe_refl_data_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-696"></span><span>                                   </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186863"><span class="hs-identifier hs-var">rr_cv</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-697"></span><span>                   </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#mkSingleAltCase"><span class="hs-identifier hs-var">mkSingleAltCase</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186862"><span class="hs-identifier hs-var">scrut2</span></a></span><span>
</span><span id="line-698"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Id
</span><a href="GHC.Core.Make.html#mkWildValBinder"><span class="hs-identifier hs-var">mkWildValBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186861"><span class="hs-identifier hs-var">scrut2_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681186877"><span class="hs-identifier hs-var">unsafe_refl_data_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-700"></span><span>                                   </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186860"><span class="hs-identifier hs-var">ab_cv</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-701"></span><span>                   </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186870"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Coercion -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#mkCast"><span class="hs-operator hs-var">`mkCast`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681186858"><span class="hs-identifier hs-var">x_co</span></a></span><span>
</span><span id="line-702"></span><span>
</span><span id="line-703"></span><span>             </span><span class="hs-special">[</span><span id="local-6989586621681186870"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186870"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186863"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186863"><span class="hs-identifier hs-var">rr_cv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186860"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186860"><span class="hs-identifier hs-var">ab_cv</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [Id]
</span><a href="GHC.Types.Id.html#mkTemplateLocals"><span class="hs-identifier hs-var">mkTemplateLocals</span></a></span><span>
</span><span id="line-704"></span><span>               </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTy"><span class="hs-identifier hs-var">openAlphaTy</span></a></span><span> </span><span class="hs-comment">-- x :: a</span><span>
</span><span id="line-705"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186855"><span class="hs-identifier hs-var">rr_cv_ty</span></a></span><span>    </span><span class="hs-comment">-- rr_cv :: r1 ~# r2</span><span>
</span><span id="line-706"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186854"><span class="hs-identifier hs-var">ab_cv_ty</span></a></span><span>    </span><span class="hs-comment">-- ab_cv :: (alpha |&gt; alpha_co ~# beta)</span><span>
</span><span id="line-707"></span><span>               </span><span class="hs-special">]</span><span>
</span><span id="line-708"></span><span>
</span><span id="line-709"></span><span>             </span><span class="hs-comment">-- Returns (scrutinee, scrutinee type, type of covar in AltCon)</span><span>
</span><span id="line-710"></span><span>             </span><span id="local-6989586621681186853"><span class="annot"><span class="annottext">unsafe_equality :: Type -&gt; Type -&gt; Type -&gt; (CoreExpr, Type, Type)
</span><a href="#local-6989586621681186853"><span class="hs-identifier hs-var hs-var">unsafe_equality</span></a></span></span><span> </span><span id="local-6989586621681186852"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186852"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621681186851"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186851"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681186850"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186850"><span class="hs-identifier hs-var">b</span></a></span></span><span>
</span><span id="line-711"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186883"><span class="hs-identifier hs-var">unsafe_equality_proof_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186852"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186850"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186851"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-712"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681186880"><span class="hs-identifier hs-var">unsafe_equality_tc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186852"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186850"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186851"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-713"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.Coercion.html#mkHeteroPrimEqPred"><span class="hs-identifier hs-var">mkHeteroPrimEqPred</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186852"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186852"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186851"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186850"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-714"></span><span>                 </span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span>             </span><span class="hs-comment">-- NB: UnsafeRefl :: (b ~# a) -&gt; UnsafeEquality a b, so we have to</span><span>
</span><span id="line-716"></span><span>             </span><span class="hs-comment">-- carefully swap the arguments above</span><span>
</span><span id="line-717"></span><span>
</span><span id="line-718"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681186868"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186868"><span class="hs-identifier hs-var">scrut1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186865"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186865"><span class="hs-identifier hs-var">scrut1_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186855"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186855"><span class="hs-identifier hs-var">rr_cv_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type -&gt; (CoreExpr, Type, Type)
</span><a href="#local-6989586621681186853"><span class="hs-identifier hs-var">unsafe_equality</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#runtimeRepTy"><span class="hs-identifier hs-var">runtimeRepTy</span></a></span><span>
</span><span id="line-719"></span><span>                                                             </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep1Ty"><span class="hs-identifier hs-var">runtimeRep1Ty</span></a></span><span>
</span><span id="line-720"></span><span>                                                             </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep2Ty"><span class="hs-identifier hs-var">runtimeRep2Ty</span></a></span><span>
</span><span id="line-721"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681186862"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186862"><span class="hs-identifier hs-var">scrut2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186861"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186861"><span class="hs-identifier hs-var">scrut2_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681186854"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186854"><span class="hs-identifier hs-var">ab_cv_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type -&gt; (CoreExpr, Type, Type)
</span><a href="#local-6989586621681186853"><span class="hs-identifier hs-var">unsafe_equality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="GHC.Builtin.Types.Prim.html#tYPE"><span class="hs-identifier hs-var">tYPE</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep2Ty"><span class="hs-identifier hs-var">runtimeRep2Ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span>                                                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTy"><span class="hs-identifier hs-var">openAlphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Coercion -&gt; Type
</span><a href="GHC.Core.Type.html#mkCastTy"><span class="hs-operator hs-var">`mkCastTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681186843"><span class="hs-identifier hs-var">alpha_co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-723"></span><span>                                                             </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openBetaTy"><span class="hs-identifier hs-var">openBetaTy</span></a></span><span>
</span><span id="line-724"></span><span>
</span><span id="line-725"></span><span>             </span><span class="hs-comment">-- alpha_co :: TYPE r1 ~# TYPE r2</span><span>
</span><span id="line-726"></span><span>             </span><span class="hs-comment">-- alpha_co = TYPE rr_cv</span><span>
</span><span id="line-727"></span><span>             </span><span id="local-6989586621681186843"><span class="annot"><span class="annottext">alpha_co :: Coercion
</span><a href="#local-6989586621681186843"><span class="hs-identifier hs-var hs-var">alpha_co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Role -&gt; TyCon -&gt; [Coercion] -&gt; Coercion
Role -&gt; TyCon -&gt; [Coercion] -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkTyConAppCo"><span class="hs-identifier hs-var">mkTyConAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.Prim.html#tYPETyCon"><span class="hs-identifier hs-var">tYPETyCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkCoVarCo"><span class="hs-identifier hs-var">mkCoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186863"><span class="hs-identifier hs-var">rr_cv</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span>             </span><span class="hs-comment">-- x_co :: alpha ~R# beta</span><span>
</span><span id="line-730"></span><span>             </span><span id="local-6989586621681186858"><span class="annot"><span class="annottext">x_co :: Coercion
</span><a href="#local-6989586621681186858"><span class="hs-identifier hs-var hs-var">x_co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role -&gt; Type -&gt; MCoercionN -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkGReflCo"><span class="hs-identifier hs-var">mkGReflCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTy"><span class="hs-identifier hs-var">openAlphaTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; MCoercionN
</span><a href="GHC.Core.TyCo.Rep.html#MCo"><span class="hs-identifier hs-var">MCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681186843"><span class="hs-identifier hs-var">alpha_co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; Coercion -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkTransCo"><span class="hs-operator hs-var">`mkTransCo`</span></a></span><span>
</span><span id="line-731"></span><span>                    </span><span class="annot"><span class="annottext">Coercion -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkSubCo"><span class="hs-identifier hs-var">mkSubCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkCoVarCo"><span class="hs-identifier hs-var">mkCoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186860"><span class="hs-identifier hs-var">ab_cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-732"></span><span>
</span><span id="line-733"></span><span>
</span><span id="line-734"></span><span>             </span><span id="local-6989586621681186833"><span class="annot"><span class="annottext">info :: IdInfo
</span><a href="#local-6989586621681186833"><span class="hs-identifier hs-var hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="GHC.Types.Id.Info.html#noCafIdInfo"><span class="hs-identifier hs-var">noCafIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; InlinePragma -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setInlinePragInfo"><span class="hs-operator hs-var">`setInlinePragInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="GHC.Types.Basic.html#alwaysInlinePragma"><span class="hs-identifier hs-var">alwaysInlinePragma</span></a></span><span>
</span><span id="line-735"></span><span>                                </span><span class="annot"><span class="annottext">IdInfo -&gt; Unfolding -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setUnfoldingInfo"><span class="hs-operator hs-var">`setUnfoldingInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#mkCompulsoryUnfolding"><span class="hs-identifier hs-var">mkCompulsoryUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186876"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-736"></span><span>
</span><span id="line-737"></span><span>             </span><span id="local-6989586621681186827"><span class="annot"><span class="annottext">ty :: Type
</span><a href="#local-6989586621681186827"><span class="hs-identifier hs-var hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep1TyVar"><span class="hs-identifier hs-var">runtimeRep1TyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#runtimeRep2TyVar"><span class="hs-identifier hs-var">runtimeRep2TyVar</span></a></span><span>
</span><span id="line-738"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTyVar"><span class="hs-identifier hs-var">openAlphaTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#openBetaTyVar"><span class="hs-identifier hs-var">openBetaTyVar</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-739"></span><span>                  </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openAlphaTy"><span class="hs-identifier hs-var">openAlphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#openBetaTy"><span class="hs-identifier hs-var">openBetaTy</span></a></span><span>
</span><span id="line-740"></span><span>
</span><span id="line-741"></span><span>             </span><span id="local-6989586621681186824"><span class="annot"><span class="annottext">id :: Id
</span><a href="#local-6989586621681186824"><span class="hs-identifier hs-var hs-var">id</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkExportedVanillaId"><span class="hs-identifier hs-var">mkExportedVanillaId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unsafeCoercePrimName"><span class="hs-identifier hs-var">unsafeCoercePrimName</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681186827"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; IdInfo -&gt; Id
</span><a href="GHC.Types.Id.html#setIdInfo"><span class="hs-operator hs-var">`setIdInfo`</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681186833"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-742"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Binding -&gt; IOEnv (Env DsGblEnv DsLclEnv) Binding
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681186824"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681186884"><span class="hs-identifier hs-var">old_expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-743"></span><span>
</span><span id="line-744"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-745"></span></pre></body></html>